From 85f43b0dc69b8c936e9392aa63d6690385b52cff Mon Sep 17 00:00:00 2001 From: Wayne Walker Date: Mon, 26 Sep 2022 15:20:13 -0500 Subject: [PATCH] Add support for options on the shebang line --- hooks/shellcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/shellcheck.sh b/hooks/shellcheck.sh index 6bb98e32..0ef5c3d2 100755 --- a/hooks/shellcheck.sh +++ b/hooks/shellcheck.sh @@ -36,7 +36,7 @@ parse_arguments() { parse_arguments "$@" for FILE in $files; do - SHEBANG_REGEX='^#!\(/\|/.*/\|/.* \)\(\(ba\|da\|k\|a\)*sh\|bats\)$' + SHEBANG_REGEX='^#!\(/\|/.*/\|/.* \)\(\(ba\|da\|k\|a\)*sh\|bats\)\( [^ ]*\)*$' if (head -1 "$FILE" | grep "$SHEBANG_REGEX" >/dev/null); then if ! shellcheck ${enable_list:+ --enable="$enable_list"} "$FILE"; then exit_status=1