Exit when no TEST_AREA is found

Prevents find command on L58 from passing the current working directory to the loop
This commit is contained in:
Eric Nemchik 2023-03-31 13:41:47 -05:00
parent e26895a986
commit 41bfe83e37

View File

@ -39,6 +39,12 @@ if [[ -d "${WORKSPACE}"/root/etc/s6-overlay/s6-rc.d ]]; then
TEST_AREA+=("root/etc/s6-overlay/s6-rc.d")
fi
# exit gracefully if no TEST_AREA are found
if [[ ${#TEST_AREA[@]} -eq 0 ]]; then
echo "no common folders found, linting not required"
exit 0
fi
# check test area for executable files
while IFS= read -r -d '' file; do
if head -n1 "${file}" | grep -q -E -w "sh|bash|dash|ksh"; then