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-09-08 01:02:25 -07:00

31 lines
586 B
Bash
Executable file

#!/usr/bin/env bash
UI_DIR="$(pwd)/hyperglass/ui"
check_typescript() {
yarn --cwd $UI_DIR typecheck
}
check_eslint() {
yarn --cwd $UI_DIR lint
}
check_prettier() {
yarn --cwd $UI_DIR prettier -c .
}
for arg in "$@"; do
if [ "$arg" == "--typescript" ]; then
check_typescript
exit $?
elif [ "$arg" == "--eslint" ]; then
check_eslint
exit $?
elif [ "$arg" == "--prettier" ]; then
check_prettier
exit $?
else
echo "Arguments --typescript, --eslint, or --prettier required."
exit 1
fi
done