Skip to content

Commit

Permalink
feat: use /usr/bin/env sh instead of direct path of sh (typicode#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz authored and nikoladavitkovski committed Sep 2, 2022
1 parent 7256ce4 commit 7d9a37f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit 7d9a37f

Please sign in to comment.