From c3d44c95c27826a7cc6275cf6ae58411097efb8f Mon Sep 17 00:00:00 2001 From: Damir Abdulganiev Date: Wed, 16 Feb 2022 17:58:36 +0300 Subject: [PATCH] Do not run frontend tests upon git hooks (#1614) * test * tst * front changes * Changes pre-commit * Changes pre-commit * Changes pre-commit * non fe change * fe change * Removes unnecessary variable * Remvoes console.log * Removes newline * Remove formating by VSCode plugin --- kafka-ui-react-app/.husky/pre-commit | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kafka-ui-react-app/.husky/pre-commit b/kafka-ui-react-app/.husky/pre-commit index 0664e92c6f..b10cf37b9c 100755 --- a/kafka-ui-react-app/.husky/pre-commit +++ b/kafka-ui-react-app/.husky/pre-commit @@ -1,4 +1,11 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -cd kafka-ui-react-app && npm run pre-commit + +if git diff --cached --name-only | grep --quiet "kafka-ui-react-app" +then + cd kafka-ui-react-app && npm run pre-commit +else + echo "Skipping frontend tests" + exit 0 +fi