From 82d1fe58b80616e61dd8ab1d1d15ff89b6bda074 Mon Sep 17 00:00:00 2001 From: severikupari1 Date: Thu, 28 Oct 2021 10:45:08 +0300 Subject: [PATCH] KYV-236 Added fix for hooks from link https://github.com/typicode/husky/issues/850#issuecomment-774231951 --- .husky/common.sh | 8 ++++++++ .husky/pre-commit | 1 + .husky/pre-push | 1 + 3 files changed, 10 insertions(+) create mode 100644 .husky/common.sh diff --git a/.husky/common.sh b/.husky/common.sh new file mode 100644 index 00000000..14870143 --- /dev/null +++ b/.husky/common.sh @@ -0,0 +1,8 @@ +command_exists () { + command -v "$1" >/dev/null 2>&1 +} + +# Windows 10, Git Bash and Yarn workaround +if command_exists winpty && test -t 1; then + exec < /dev/tty +fi \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af2198..0aefdea8 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/common.sh" npx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push index f077c917..2ca62059 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/common.sh" yarn test