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:24:48 -07:00

38 lines
637 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
exit 0
elif [ "$arg" == "--eslint" ]
then
check_eslint
exit 0
elif [ "$arg" == "--prettier" ]
then
check_prettier
exit 0
else
echo "Arguments --typescript, --eslint, or --prettier required."
exit 1
fi
done