Last active
September 29, 2022 03:53
-
-
Save jkriss/7316b2265fd9db507d03db227fc830e5 to your computer and use it in GitHub Desktop.
pre-commit hook for deno fmt formatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FILES=$(deno fmt) | |
if [ -n "$FILES" ]; then | |
echo "formatted, adding files $FILES" | |
echo "$FILES" | xargs git add | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fmt command should look like
deno fmt 2>&1 | head -n -1
if you want to store the formatted files