From 7e4f95a19b6719502fb897e4284507261ba5b59f Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 3 Jan 2021 11:10:20 -0700 Subject: [PATCH] update frontend pre-commit hook --- .tests/pre-commit-frontend.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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