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

31 lines
477 B
Bash
Raw Normal View History

2021-01-03 10:59:19 -07:00
#!/usr/bin/env bash
2021-01-03 23:21:40 -07:00
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