Skip to content

Commit 0332553

Browse files
authored
bypass checking files under docker-images directory, report absolute path of files, report all violations instead of first one (#2749)
1 parent f54d0f9 commit 0332553

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

validateScripts.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,21 @@ validate_script() {
1818
}
1919

2020

21-
find . -type f -name '*.sh' -print0 | while IFS= read -r -d '' file; do
22-
retval=$(validate_script "$file" )
23-
if [ -n "$retval" ]; then
24-
echo "$retval"
25-
exit 1
26-
fi
27-
done
21+
EXCLUDE_PATH="*/docker-images/*"
22+
23+
find "$(pwd -P)" -type f -name '*.sh' -not -path "$EXCLUDE_PATH" -print0 | {
24+
25+
return_code=0
26+
27+
while IFS= read -r -d '' file; do
28+
retval=$(validate_script "$file" )
29+
if [ -n "$retval" ]; then
30+
echo "$retval"
31+
return_code=1;
32+
fi
33+
done
34+
exit $return_code
35+
}
2836

2937
found_error=$?
3038

0 commit comments

Comments
 (0)