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): replace unsafe eval with declare in check-config.sh

Dave Morina6bd481e61a6
diff --git a/hooks/scripts/check-config.sh b/hooks/scripts/check-config.sh
index bc57dd55..3f28b036 100755
--- a/hooks/scripts/check-config.sh
+++ b/hooks/scripts/check-config.sh
@@ -33,8 +33,11 @@ load_env_vars() {
[[ -z "$key" ]] && continue
key=$(echo "$key" | xargs)
value=$(echo "$value" | xargs | sed 's/^["'\''"]//;s/["'\''"]$//')
+ # Strip inline comments (# preceded by whitespace) to prevent
+ # command substitution in backtick-containing comments
+ value="${value%%[[:space:]]#*}"
if [[ -n "$key" && -n "$value" ]]; then
- eval "ENV_${key}=\"${value}\""
+ declare "ENV_${key}=${value}"
fi
done < "$file"
fi