From ffa3fe51a6ee5f32f3135f3bf0ebadf6b4aad5d0 Mon Sep 17 00:00:00 2001 From: corlys Date: Fri, 15 Oct 2021 20:07:57 +0700 Subject: [PATCH] fix: husky https://github.com/typicode/husky/issues/850 --- .husky/commit-msg | 1 + .husky/common.sh | 8 ++++++++ .husky/pre-commit | 1 + 3 files changed, 10 insertions(+) create mode 100644 .husky/common.sh diff --git a/.husky/commit-msg b/.husky/commit-msg index d71a03b..29d991c 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/common.sh" yarn commitlint --edit $1 diff --git a/.husky/common.sh b/.husky/common.sh new file mode 100644 index 0000000..1487014 --- /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 d2ae35e..eb6e8c1 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/common.sh" yarn lint-staged