diff options
author | Ben Sima <ben@bsima.me> | 2024-04-01 15:19:49 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2024-04-01 15:19:49 -0400 |
commit | 2d40ec3a03f4684f6fabba7dee2981c992a13785 (patch) | |
tree | 1edc1522fd5eb8e6d20b1b4dbde89f3e49ad9e51 /Biz/Ide/hooks | |
parent | db373a8c727cad91d375b40a6c70b11ed73bdafb (diff) |
Rename .bash files to .sh
I was already using .sh to refer to shell scripts. When I added .bash, I didn't
realize that the linter was set to act on .sh files and not .bash files, so all
of these bash scripts escaped the linter.
This commit renames them to .sh, removes the .bash extension support from
Biz.Namespace, and fixes all the reported shellcheck errors.
Diffstat (limited to 'Biz/Ide/hooks')
-rwxr-xr-x | Biz/Ide/hooks/commit-msg.sh (renamed from Biz/Ide/hooks/commit-msg.bash) | 0 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-applypatch.sh (renamed from Biz/Ide/hooks/post-applypatch.bash) | 0 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-checkout.sh (renamed from Biz/Ide/hooks/post-checkout.bash) | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-commit.sh (renamed from Biz/Ide/hooks/post-commit.bash) | 0 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-merge.sh (renamed from Biz/Ide/hooks/post-merge.bash) | 2 | ||||
-rwxr-xr-x | Biz/Ide/hooks/post-rewrite.sh (renamed from Biz/Ide/hooks/post-rewrite.bash) | 0 | ||||
-rwxr-xr-x | Biz/Ide/hooks/pre-auto-gc.sh (renamed from Biz/Ide/hooks/pre-auto-gc.bash) | 0 | ||||
-rwxr-xr-x | Biz/Ide/hooks/pre-commit.sh (renamed from Biz/Ide/hooks/pre-commit.bash) | 6 | ||||
-rwxr-xr-x | Biz/Ide/hooks/pre-push.sh (renamed from Biz/Ide/hooks/pre-push.bash) | 7 | ||||
-rwxr-xr-x | Biz/Ide/hooks/reference-transaction.sh (renamed from Biz/Ide/hooks/reference-transaction.bash) | 0 |
10 files changed, 10 insertions, 11 deletions
diff --git a/Biz/Ide/hooks/commit-msg.bash b/Biz/Ide/hooks/commit-msg.sh index 64e400d..64e400d 100755 --- a/Biz/Ide/hooks/commit-msg.bash +++ b/Biz/Ide/hooks/commit-msg.sh diff --git a/Biz/Ide/hooks/post-applypatch.bash b/Biz/Ide/hooks/post-applypatch.sh index 5071dc5..5071dc5 100755 --- a/Biz/Ide/hooks/post-applypatch.bash +++ b/Biz/Ide/hooks/post-applypatch.sh diff --git a/Biz/Ide/hooks/post-checkout.bash b/Biz/Ide/hooks/post-checkout.sh index 982cb4b..e4a0d67 100755 --- a/Biz/Ide/hooks/post-checkout.bash +++ b/Biz/Ide/hooks/post-checkout.sh @@ -1,16 +1,16 @@ #!/usr/bin/env bash set -e -mktags=${CODEROOT:?}/Biz/Ide/mktags +mktags=${CODEROOT:?}/Biz/Ide/mktags.sh old=$1 new=$2 # filter out only the changed haskell files -changed=($(git diff --diff-filter=d --name-only $old $new -- '*.hs')) +mapfile -t changed < <(git diff --diff-filter=d --name-only "$old" "$new" -- '*.hs') if [[ ! -r tags ]] || [[ ! -r TAGS ]] then $mktags "$CODEROOT"/**/* elif [[ ${#changed[@]} -gt 0 ]] then - $mktags $changed + $mktags "${changed[@]}" fi direnv reload ## START BRANCHLESS CONFIG diff --git a/Biz/Ide/hooks/post-commit.bash b/Biz/Ide/hooks/post-commit.sh index cd1f195..cd1f195 100755 --- a/Biz/Ide/hooks/post-commit.bash +++ b/Biz/Ide/hooks/post-commit.sh diff --git a/Biz/Ide/hooks/post-merge.bash b/Biz/Ide/hooks/post-merge.sh index 94f0f60..d2cfa63 100755 --- a/Biz/Ide/hooks/post-merge.bash +++ b/Biz/Ide/hooks/post-merge.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -exec ${CODEROOT:?}/Biz/Ide/hooks/post-checkout 'HEAD@{1}' HEAD +"${CODEROOT:?}"/Biz/Ide/hooks/post-checkout 'HEAD@{1}' HEAD ## START BRANCHLESS CONFIG git branchless hook post-merge "$@" diff --git a/Biz/Ide/hooks/post-rewrite.bash b/Biz/Ide/hooks/post-rewrite.sh index 8b3237a..8b3237a 100755 --- a/Biz/Ide/hooks/post-rewrite.bash +++ b/Biz/Ide/hooks/post-rewrite.sh diff --git a/Biz/Ide/hooks/pre-auto-gc.bash b/Biz/Ide/hooks/pre-auto-gc.sh index c92a844..c92a844 100755 --- a/Biz/Ide/hooks/pre-auto-gc.bash +++ b/Biz/Ide/hooks/pre-auto-gc.sh diff --git a/Biz/Ide/hooks/pre-commit.bash b/Biz/Ide/hooks/pre-commit.sh index 560eee7..e7c34ab 100755 --- a/Biz/Ide/hooks/pre-commit.bash +++ b/Biz/Ide/hooks/pre-commit.sh @@ -4,10 +4,10 @@ # - guard against lint errors ## set -e - changed=($(git diff-index --cached --name-only HEAD)) - for ns in ${changed[@]} + mapfile -t changed < <(git diff-index --cached --name-only HEAD) + for ns in "${changed[@]}" do - version=$(${CODEROOT:?}/Biz/Ide/version $ns) + version=$("${CODEROOT:?}"/Biz/Ide/version "$ns") if [[ $version -eq -1 ]]; then echo "info: version: $ns: deleted" elif [[ $version -lt 1 ]]; then diff --git a/Biz/Ide/hooks/pre-push.bash b/Biz/Ide/hooks/pre-push.sh index 5abd3ee..16f11d1 100755 --- a/Biz/Ide/hooks/pre-push.bash +++ b/Biz/Ide/hooks/pre-push.sh @@ -17,12 +17,11 @@ commit=$(git notes --ref=ci show HEAD || true) if [[ -n "$commit" ]] then - lint_ok=$() - if grep -q "Lint-is: good" <<< $commit + if grep -q "Lint-is: good" <<< "$commit" then exit 0 fi - if grep -q "Test-is: good" <<< $commit + if grep -q "Test-is: good" <<< "$commit" then exit 0 fi @@ -36,7 +35,7 @@ exit 1 fi ## - if bild ${BILD_ARGS:-""} --test "${CODEROOT:?}"/**/* + if bild "${BILD_ARGS:-""}" --test "${CODEROOT:?}"/**/* then test_result="good" else diff --git a/Biz/Ide/hooks/reference-transaction.bash b/Biz/Ide/hooks/reference-transaction.sh index ea0cce6..ea0cce6 100755 --- a/Biz/Ide/hooks/reference-transaction.bash +++ b/Biz/Ide/hooks/reference-transaction.sh |