Re-enable shfmt in pre-commit hook
This commit is contained in:
parent
7e48c8f75a
commit
4255c7eba0
1 changed files with 8 additions and 8 deletions
|
@ -31,14 +31,14 @@ if [ "$num_staged_lua" -gt 0 ]; then
|
|||
fi
|
||||
|
||||
# Run shfmt on staged shell scripts
|
||||
#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"
|
||||
# printf "Re-staging\n\n"
|
||||
# git add "$staged_sh"
|
||||
#fi
|
||||
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"
|
||||
printf "Re-staging\n\n"
|
||||
git add "$staged_sh"
|
||||
fi
|
||||
|
||||
# Run prettier on all other staged files
|
||||
# that are supported
|
||||
|
|
Loading…
Reference in a new issue