diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh index 8de639c0..7bff76d5 100755 --- a/.husky/_/husky.sh +++ b/.husky/_/husky.sh @@ -1,9 +1,17 @@ #!/usr/bin/env sh # -# Husky Helper Script +# Husky Helper Script - Conditional Activation # This file is sourced by all Husky hooks # if [ -z "$husky_skip_init" ]; then + # Check if Husky is enabled for this user + if [ "$HUSKY_ENABLED" != "1" ] && [ ! -f .husky-enabled ]; then + echo "Husky is not enabled. To enable:" + echo " export HUSKY_ENABLED=1" + echo " or create .husky-enabled file" + exit 0 + fi + debug () { if [ "$HUSKY_DEBUG" = "1" ]; then echo "husky (debug) - $1"