Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed May 11, 2023
1 parent da44f7b commit 735a278
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions husky.sh
@@ -1,41 +1,41 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug() {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

readonly husky_skip_init=1
export husky_skip_init

if [ "$(basename -- "$SHELL")" = "zsh" ]; then
zsh --emulate sh -e "$0" "$@"
else
sh -e "$0" "$@"
fi
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi

exit $exitCode
debug() {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

readonly husky_skip_init=1
export husky_skip_init

if [ "$(basename -- "$SHELL")" = "zsh" ]; then
zsh --emulate sh -e "$0" "$@"
else
sh -e "$0" "$@"
fi
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi

exit $exitCode
fi

0 comments on commit 735a278

Please sign in to comment.