Skip to content

Commit

Permalink
Hopefully fix Husky 5 on Windows and close #385
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Jun 1, 2021
1 parent e0d9c30 commit d910458
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://github.com/typicode/husky/issues/850#issuecomment-774231951

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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn lint-staged

0 comments on commit d910458

Please sign in to comment.