Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not depend on the exact location of the 'sh' interpreter #1089

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/commit-msg
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npm test
2 changes: 1 addition & 1 deletion docs/README.md
Expand Up @@ -399,7 +399,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"

Expand Down
2 changes: 1 addition & 1 deletion husky.sh
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -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}
Expand Down