From 0da2776f53721d982b7666170acf0ea55ecabd6b Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 3 Jan 2021 11:16:03 -0700 Subject: [PATCH] test pre-commit hook --- .pre-commit-config.yaml | 2 ++ .tests/pre-commit-frontend.sh | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index adc3ad9..db32a85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,8 @@ repos: hooks: - id: frontend_checks name: Frontend Checks + files: 'hyperglass/ui/*' + exclude: 'hyperglass/ui/node_modules' stages: - commit entry: ./.tests/pre-commit-frontend.sh diff --git a/.tests/pre-commit-frontend.sh b/.tests/pre-commit-frontend.sh index 4960947..26d1567 100755 --- a/.tests/pre-commit-frontend.sh +++ b/.tests/pre-commit-frontend.sh @@ -2,11 +2,14 @@ UI_DIR="./hyperglass/ui" -if git diff --cached --name-only | grep --quiet $UI_DIR -then - cd $UI_DIR - node_modules/.bin/tsc -else - echo "No frontend files have changed, skipping pre-commit check..." - exit 0 -fi +cd $UI_DIR +node_modules/.bin/tsc + +# if git diff --cached --name-only | grep --quiet $UI_DIR +# then +# cd $UI_DIR +# node_modules/.bin/tsc +# else +# echo "No frontend files have changed, skipping pre-commit check..." +# exit 0 +# fi