Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export HUSKY=0 in a config has no effect #1393

Comments

@alecmev
Copy link

alecmev commented Feb 12, 2024

$HUSKY is evaluated before the configs are sourced, so its presence doesn't trigger exit 0:

husky/husky

Lines 2 to 14 in 095a4fe

H="$HUSKY"
[ "$H" = "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
[ "$H" = "0" ] && exit 0

Are the docs out-ot-date and I'm expected to put export H=0 in init.sh? Or something else is wrong?

@typicode
Copy link
Owner

Good catch. It's a bug. It was moved there to fix #1358. I'll publish a new version.

@typicode typicode reopened this Feb 12, 2024
@typicode
Copy link
Owner

Should be good 👍

@alecmev
Copy link
Author

alecmev commented Feb 16, 2024

It is, thank you!

@alecmev alecmev closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment