Skip to content

Commit

Permalink
Bumped husky hook scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Nov 29, 2024
1 parent f6d303d commit ca5c7d3
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .husky/_/applypatch-msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/commit-msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
23 changes: 12 additions & 11 deletions .husky/_/h
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/usr/bin/env sh
H="$HUSKY"
[ "$H" = "2" ] && set -x
h="${0##*/}"
s="${0%/*/*}/$h"
[ "$HUSKY" = "2" ] && set -x
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n

[ ! -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
if [ -f "$HOME/.huskyrc" ]; then
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
fi
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
[ -f "$i" ] && . "$i"

[ "$H" = "0" ] && exit 0
[ "${HUSKY-}" = "0" ] && exit 0

export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
c=$?

[ $c != 0 ] && echo "husky - $h script failed (code $c)"
[ $c != 0 ] && echo "husky - $n script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
exit $c
9 changes: 9 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "husky - DEPRECATED
Please remove the following two lines from $0:
#!/usr/bin/env sh
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
They WILL FAIL in v10.0.0
"
2 changes: 1 addition & 1 deletion .husky/_/post-applypatch
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/post-checkout
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/post-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/post-merge
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/post-rewrite
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/pre-applypatch
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/pre-auto-gc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/pre-rebase
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"
2 changes: 1 addition & 1 deletion .husky/_/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
. "${0%/*}/h"
. "$(dirname "$0")/h"

0 comments on commit ca5c7d3

Please sign in to comment.