UNPKG

423 Bapplication/x-shView Raw
1#!/usr/bin/env sh
2H="$HUSKY"
3[ "$H" = "2" ] && set -x
4h="${0##*/}"
5s="${0%/*/*}/$h"
6
7[ ! -f "$s" ] && exit 0
8
9for f in "${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" "$HOME/.huskyrc"; do
10 # shellcheck disable=SC1090
11 [ -f "$f" ] && . "$f"
12done
13
14[ "$H" = "0" ] && exit 0
15
16sh -e "$s" "$@"
17c=$?
18
19[ $c != 0 ] && echo "husky - $h script failed (code $c)"
20[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
21exit $c
\No newline at end of file