20 lines
423 B
Plaintext
20 lines
423 B
Plaintext
|
|
#!/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"; 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 $c
|