1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
checktheroads-hyperglass/.tests/pre-commit-frontend.sh
checktheroads 88a9b90e96 fix pre-commit
2021-01-03 23:22:38 -07:00

31 lines
477 B
Bash
Executable File

#!/usr/bin/env bash
UI_DIR="$(pwd)/hyperglass/ui"
check_typescript () {
cd $UI_DIR
node_modules/.bin/tsc
}
check_eslint () {
cd $UI_DIR
node_modules/.bin/eslint .
}
check_prettier () {
cd $UI_DIR
node_modules/.bin/prettier -c -w .
}
for arg in "$@"
do
if [ "$arg" == "--typescript" ]
then
check_typescript
else [ "$arg" == "--eslint" ]
check_eslint
else [ "$arg" == "--prettier" ]
check_prettier
fi
done