diff --git a/husky.sh b/husky.sh index bb15047f4..fe184c087 100644 --- a/husky.sh +++ b/husky.sh @@ -12,13 +12,7 @@ done [ "$HUSKY" = "0" ] && exit 0 -[ "${SHELL##*/}" = "zsh" ] && sh="zsh" || sh="sh" - -# shellcheck disable=SC2155 -[ "$h" = "pre-commit" ] && export STAGED="$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')" -export PATH="./node_modules/.bin:$PATH" - -$sh -e "$s" "$@" +sh -e "$s" "$@" c=$? [ $c != 0 ] && echo "husky - $h script failed (code $c)" diff --git a/index.js b/index.js index fc2eeb42c..71e4caa9b 100644 --- a/index.js +++ b/index.js @@ -20,4 +20,4 @@ export default (d = '.husky') => { l.forEach(h => w(_(h), `#!/usr/bin/env sh\n. "\${0%/*}/h"`, { mode: 0o755 })) w(_('husky.sh'), '') return '' -} +} \ No newline at end of file