oneuptime/git-hooks/pre-commit
Nawaz Dhandala dd0a1ab435 fix redme.
2020-09-11 12:40:15 +09:00

23 lines
No EOL
506 B
Bash

#!/bin/sh
# Run these command in your terminal from the root of this project.
# ```
# root="$(pwd)"
# ln -s "$root/git-hooks" "$root/.git/hooks"
# ```
function jslint {
printf "\nValidating and Linting Javascript. This will take few minutes...\n"
npm run lint
if [[ "$?" != 0 ]]; then
printf "There are lint errors for your commit. Please run 'npm run fix-lint` to fix them.\n"
exit 1
fi
popd
printf "\nJavascript Validating and Linting Completed!\n"
}
jslint