diff --git a/.husky/commit-msg b/.husky/commit-msg index 0bd658f49..14d810e56 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 449fcdee1..5834969d0 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" npm test diff --git a/docs/README.md b/docs/README.md index 62f1bc4c8..e75850c4a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -394,7 +394,7 @@ fi 2. Source it in in places where Yarn is used to run commands: ```shell -#!/bin/sh +#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/common.sh" diff --git a/husky.sh b/husky.sh index 6809ccca2..a9bd5ee2f 100644 --- a/husky.sh +++ b/husky.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh if [ -z "$husky_skip_init" ]; then debug () { if [ "$HUSKY_DEBUG" = "1" ]; then diff --git a/src/index.ts b/src/index.ts index 7902c4075..3a8b2bd50 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,7 +63,7 @@ export function set(file: string, cmd: string): void { fs.writeFileSync( file, - `#!/bin/sh + `#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" ${cmd}