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
|
fi
|
||||||
|
|
||||||
# Run shfmt on staged shell scripts
|
# Run shfmt on staged shell scripts
|
||||||
#staged_sh=$(echo "$staged_files" | grep -E '(.sh$|pre-commit)' || true)
|
staged_sh=$(echo "$staged_files" | grep -E '(.sh$|pre-commit)' || true)
|
||||||
#num_staged_sh=$(echo "$staged_sh" | grep -vce '^$' || true)
|
num_staged_sh=$(echo "$staged_sh" | grep -vce '^$' || true)
|
||||||
#if [ "$num_staged_sh" -gt 0 ]; then
|
if [ "$num_staged_sh" -gt 0 ]; then
|
||||||
# printf '\nFormatting %s staged shell scripts with shfmt\n' "$num_staged_sh"
|
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"
|
printf "Re-staging\n\n"
|
||||||
# git add "$staged_sh"
|
git add "$staged_sh"
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
# Run prettier on all other staged files
|
# Run prettier on all other staged files
|
||||||
# that are supported
|
# that are supported
|
||||||
|
|
Loading…
Reference in a new issue