diff --git a/.tests/pre-commit-frontend.sh b/.tests/pre-commit-frontend.sh index cbc375f..2789129 100755 --- a/.tests/pre-commit-frontend.sh +++ b/.tests/pre-commit-frontend.sh @@ -1,13 +1,12 @@ #!/usr/bin/env bash -$UI_DIR="hyperglass/ui" +UI_DIR="./hyperglass/ui" -if git diff --cached --name-only | grep --quiet "$UI_DIR" +if git diff --cached --name-only | grep --quiet $UI_DIR then + cd $UI_DIR + yarn typecheck +else echo "No frontend files have changed, skipping pre-commit check..." exit 0 fi - -cd $UI_DIR - -yarn typecheck