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: use GNU stat first in check_perms so Linux doesn't false-warn

george2312243d57db9644ab
diff --git a/hooks/scripts/check-config.sh b/hooks/scripts/check-config.sh
index 3fba6e09..39b4bbdc 100755
--- a/hooks/scripts/check-config.sh
+++ b/hooks/scripts/check-config.sh
@@ -12,7 +12,11 @@ check_perms() {
local file="$1"
if [[ ! -f "$file" ]]; then return; fi
local perms
- perms=$(stat -f '%Lp' "$file" 2>/dev/null || stat -c '%a' "$file" 2>/dev/null || echo "")
+ # Try GNU stat first (Linux), fall back to BSD stat (macOS).
+ # On Linux, `stat -f` prints filesystem info (not permissions) and exits 0,
+ # so the previous BSD-first ordering left $perms as multi-line garbage on
+ # every Linux session start and printed a false WARNING.
+ perms=$(stat -c '%a' "$file" 2>/dev/null || stat -f '%Lp' "$file" 2>/dev/null || echo "")
if [[ -n "$perms" && "$perms" != "600" && "$perms" != "400" ]]; then
echo "/last30days: WARNING — $file has permissions $perms (should be 600)."
echo " Fix: chmod 600 $file"