frontend/hooks/pre-commit.sh
2020-05-12 15:18:33 +02:00

13 lines
280 B
Bash
Executable file

#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
# Prettify all selected files
cd $(git rev-parse --show-toplevel)/smart-hut
npm run eslint-fix
cd ..
# Add back the modified/prettified files to staging
echo "$FILES" | xargs git add
exit 0