From 7818613ec8aaa529fb776d9e1f216c1d9e662dd5 Mon Sep 17 00:00:00 2001 From: Rodrigo Delduca Date: Thu, 17 Feb 2022 02:55:20 -0300 Subject: [PATCH] feat: use /usr/bin/env sh instead of direct path of sh (#1051) --- .husky/commit-msg | 2 +- .husky/pre-commit | 2 +- docs/README.md | 2 +- husky.sh | 2 +- src/index.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 cd74c1f99..34684d396 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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" 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}