mirror of
https://github.com/hanzoai/husky.git
synced 2026-09-24 16:59:45 +00:00
21 lines
423 B
Bash
21 lines
423 B
Bash
#!/usr/bin/env sh
|
|
[ "$HUSKY" = "2" ] && set -x
|
|
h="${0##*/}"
|
|
s="${0%/*/*}/$h"
|
|
|
|
[ ! -f "$s" ] && exit 0
|
|
|
|
for f in "${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" "$HOME/.huskyrc.sh"; do
|
|
# shellcheck disable=SC1090
|
|
[ -f "$f" ] && . "$f"
|
|
done
|
|
|
|
[ "$HUSKY" = "0" ] && exit 0
|
|
|
|
sh -e "$s" "$@"
|
|
c=$?
|
|
|
|
[ $c != 0 ] && echo "husky - $h script failed (code $c)"
|
|
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
|
|
exit 1
|