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

Fix unbound variable #1359

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions husky.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
[ "$HUSKY" = "2" ] && set -x
H="$HUSKY"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't fix anything, you still have unbound $HUSKY access. what you should had done is H="${HUSKY:-}" which was actually described in #1358 issue body.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feedback is in the pr itself:

[ "$H" = "2" ] && set -x
h="${0##*/}"
s="${0%/*/*}/$h"

Expand All @@ -10,7 +11,7 @@ for f in "${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" "$HOME/.huskyrc.sh";
[ -f "$f" ] && . "$f"
done

[ "$HUSKY" = "0" ] && exit 0
[ "$H" = "0" ] && exit 0

sh -e "$s" "$@"
c=$?
Expand Down
Loading