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
|
2021-01-03 23:50:23 -07:00
|
|
|
node_modules/.bin/tsc --noEmit
|
2021-01-03 23:21:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2021-01-04 00:18:23 -07:00
|
|
|
exit $?
|
2021-01-03 23:24:48 -07:00
|
|
|
elif [ "$arg" == "--eslint" ]
|
|
|
|
then
|
2021-01-03 23:21:40 -07:00
|
|
|
check_eslint
|
2021-01-04 00:18:23 -07:00
|
|
|
exit $?
|
2021-01-03 23:24:48 -07:00
|
|
|
elif [ "$arg" == "--prettier" ]
|
|
|
|
then
|
2021-01-03 23:21:40 -07:00
|
|
|
check_prettier
|
2021-01-04 00:18:23 -07:00
|
|
|
exit $?
|
2021-01-03 23:24:48 -07:00
|
|
|
else
|
|
|
|
echo "Arguments --typescript, --eslint, or --prettier required."
|
|
|
|
exit 1
|
2021-01-03 23:21:40 -07:00
|
|
|
fi
|
|
|
|
done
|