Skip to content

Commit

Permalink
🐛 Fix husky issue with windows stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
PatoGuereque committed Oct 14, 2021
1 parent 6c1bf4d commit 97f748f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .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
1 change: 1 addition & 0 deletions .husky/pre-commit
@@ -1,4 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn lint-staged
1 change: 1 addition & 0 deletions .husky/pre-push
@@ -1,4 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn lint

0 comments on commit 97f748f

Please sign in to comment.