index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2023-05-22 16:29:47 +0200 |
---|---|---|
committer | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2023-05-22 16:29:47 +0200 |
commit | 709590e525ff812f73c18f67496c068bd4da8659 (patch) | |
tree | 75f79e9be2b161d99fa19e646c733bceac2834eb | |
parent | 62f871fb25b70860364b0023745c0f31516e69d0 (diff) |
-rwxr-xr-x | bin/strict-bashism-check | 13 |
diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check index 8e58e05..b5a8eb6 100755 --- a/bin/strict-bashism-check +++ b/bin/strict-bashism-check @@ -8,6 +8,11 @@ else against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi +check_files=$( + git diff --cached --name-status "${against}" \ + | cut -f2 +) + # If you want to allow non-ASCII filenames set this variable to true. allownonascii=$(git config --bool hooks.allownonascii) @@ -93,7 +98,13 @@ if command -v shellcheck >/dev/null 2>&1; then -not -name 'opcode' \ -not -name 'opcode_list' \ -not -name '.*' \ - -execdir shellcheck -x '{}' \; 2>&1 + | grep -xF "${check_files}" \ + | while read -r file; do + ( + cd "${file%/*}" || exit $? + shellcheck -x "${file##*/}" 2>&1 + ) + done ) if [ -n "${errors}" ]; then |