We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5146b88 commit afdc588Copy full SHA for afdc588
.githooks/pre-commit/01-shellcheck.sh
@@ -13,6 +13,10 @@ exec_files=$(find $diff_files -exec sh -c 'head -n1 $1 | grep -qE '"'"'^#!(.*/|\
13
# shellcheck disable=SC2086
14
sh_files=$(find $diff_files \( -name '*.sh' -or -name '*.bash' \))
15
all_files=`echo -e "$sh_files\n$exec_files" | sort | uniq`
16
+if [ -z "$all_files" ]; then
17
+ echo "No shell files found to check"
18
+ exit 0
19
+fi
20
echo "Running shellcheck on the following files:"
21
echo "$all_files"
22
0 commit comments