diff --git a/Jenkinsfile b/Jenkinsfile index 8dc6e0c..60d095c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,9 +36,9 @@ pipeline { exit 1 } - invalid_type=$(find "${ASSET_SOURCE_DIR}" ! -type d ! -type f -print -quit) - test -z "${invalid_type}" || { - echo "ERROR: publishable assets must be regular files: ${invalid_type}" >&2 + unexpected_type=$(find "${ASSET_SOURCE_DIR}" -mindepth 1 ! -type f -print -quit) + test -z "${unexpected_type}" || { + echo "ERROR: publishable assets must be regular files: ${unexpected_type}" >&2 exit 1 } @@ -52,10 +52,9 @@ pipeline { task_count=$((task_count + 1)) done - unexpected=$(find "${ASSET_SOURCE_DIR}" -mindepth 1 \ - \( ! -type f -o ! -name '*.task.md' \) -print -quit) - test -z "${unexpected}" || { - echo "ERROR: unexpected file in ${ASSET_SOURCE_DIR}: ${unexpected}" >&2 + unexpected_name=$(find "${ASSET_SOURCE_DIR}" -mindepth 1 -type f ! -name '*.task.md' -print -quit) + test -z "${unexpected_name}" || { + echo "ERROR: unexpected file in ${ASSET_SOURCE_DIR}: ${unexpected_name}" >&2 exit 1 }