Skip to content

Instantly share code, notes, and snippets.

@simon-abbott
Created March 9, 2026 05:09
Show Gist options
  • Select an option

  • Save simon-abbott/6cdef950cba4382a17fac8fb63384a74 to your computer and use it in GitHub Desktop.

Select an option

Save simon-abbott/6cdef950cba4382a17fac8fb63384a74 to your computer and use it in GitHub Desktop.
diff --git a/node_modules/husky/husky b/node_modules/husky/husky
index bf7c896..5b4c69c 100644
--- a/node_modules/husky/husky
+++ b/node_modules/husky/husky
@@ -3,15 +3,18 @@
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n
-[ ! -f "$s" ] && exit 0
-
-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"
+# PATCH: Fix for https://github.com/typicode/husky/issues/1606
+if [ -f "$i" ]; then
+ . "$i"
+elif [ -f "$HOME/.huskyrc" ]; then
+ i="$(echo "$i" | sed "s|$HOME|~|")"
+ echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to $i"
+fi
[ "${HUSKY-}" = "0" ] && exit 0
+# PATCH: Fix for https://github.com/typicode/husky/issues/1632
+[ ! -f "$s" ] && exit 0
export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment