Skip to content

Commit

Permalink
perf: use POSIX-defined parameter expansion (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Sep 22, 2023
1 parent 358f833 commit 4f7f37f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions husky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ -z "$husky_skip_init" ]; then
fi
}

readonly hook_name="$(basename -- "$0")"
readonly hook_name="${0##*/}"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
Expand All @@ -25,7 +25,7 @@ if [ -z "$husky_skip_init" ]; then
readonly husky_skip_init=1
export husky_skip_init

if [ "$(basename -- "$SHELL")" = "zsh" ]; then
if [ "${SHELL##*/}" = "zsh" ]; then
zsh --emulate sh -e "$0" "$@"
else
sh -e "$0" "$@"
Expand Down

0 comments on commit 4f7f37f

Please sign in to comment.