Fixes to precommit hook and reformat some zsh files

This commit is contained in:
Marko Korhonen 2022-10-26 14:13:15 +03:00
parent 3614b66354
commit e85469a11b
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
4 changed files with 19 additions and 19 deletions

View file

@ -17,7 +17,7 @@ if [ "$num_staged_toml" -gt 0 ]; then
printf '\nFormatting %s staged TOML files with taplo\n' "$num_staged_toml"
taplo format "$staged_toml"
printf "Re-staging\n"
git add "$staged_toml"
git add $staged_toml
fi
# Run lua-format on staged Lua files
@ -39,9 +39,9 @@ staged_sh=$(echo "$staged_files" | grep -E '(.sh$|pre-commit)' || true)
num_staged_sh=$(echo "$staged_sh" | grep -vce '^$' || true)
if [ "$num_staged_sh" -gt 0 ]; then
printf '\nFormatting %s staged shell scripts with shfmt\n' "$num_staged_sh"
shfmt -w "$staged_sh"
shfmt -w $staged_sh
printf "Re-staging\n\n"
git add "$staged_sh"
git add $staged_sh
fi
# Run prettier on all other staged files