1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00
thatmattlove-hyperglass/.tests/pre-commit-frontend.sh
2021-01-03 23:21:40 -07:00

32 lines
495 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" ]
then
check_eslint
else [ "$arg" == "--prettier" ]
then
check_prettier
fi
done