Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix(hooks): use printf -v for bash 3.2 compat (declare -g is 4.2+)

Trevin Chow46cf2328aad8
diff --git a/hooks/scripts/check-config.sh b/hooks/scripts/check-config.sh
index c5a8f090..bb20a6ea 100755
--- a/hooks/scripts/check-config.sh
+++ b/hooks/scripts/check-config.sh
@@ -37,7 +37,9 @@ load_env_vars() {
# command substitution in backtick-containing comments
value="${value%%[[:space:]]#*}"
if [[ -n "$key" && -n "$value" ]]; then
- declare -g "ENV_${key}=${value}"
+ # printf -v writes via assignment semantics (global from inside a
+ # function), works on macOS's /bin/bash 3.2 — `declare -g` is 4.2+.
+ printf -v "ENV_${key}" '%s' "$value"
fi
done < "$file"
fi