diff options
| author | secondl1ght <[email protected]> | 2022-03-08 21:52:07 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-08 21:52:07 -0700 |
| commit | e660c662de6ace7e61277b001d86bbf08d4444df (patch) | |
| tree | 844bd40da16d4371969f4036a0c5ba9d445798a6 /git_hooks/pre-commit | |
| parent | f5c1040fbf6d8998d69fb5feaf4a832599b92dd1 (diff) | |
| download | coinos-server-e660c662de6ace7e61277b001d86bbf08d4444df.tar.gz coinos-server-e660c662de6ace7e61277b001d86bbf08d4444df.zip | |
Add files via upload
Diffstat (limited to 'git_hooks/pre-commit')
| -rw-r--r-- | git_hooks/pre-commit | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit new file mode 100644 index 00000000..78876285 --- /dev/null +++ b/git_hooks/pre-commit @@ -0,0 +1,11 @@ +#!/bin/sh +FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') +[ -z "$FILES" ] && exit 0 + +# Prettify all selected files +echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write + +# Add back the modified/prettified files to staging +echo "$FILES" | xargs git add + +exit 0 |
