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: only print auto-fixed message on successful chmod; remove duplicate import

23241a67490381df502554
diff --git a/hooks/scripts/check-config.sh b/hooks/scripts/check-config.sh
index 7452bc9f..b48b104d 100755
--- a/hooks/scripts/check-config.sh
+++ b/hooks/scripts/check-config.sh
@@ -28,9 +28,7 @@ check_perms() {
# 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
- chmod 600 "$file" 2>/dev/null || true
- echo "/last30days: WARNING — $file has permissions $perms (should be 600)."
- echo " Auto-fixed with: chmod 600 $file"
+ chmod 600 "$file" && echo "/last30days: WARNING — $file had permissions $perms — auto-fixed with chmod 600" || echo "/last30days: WARNING — $file has permissions $perms (should be 600). Fix: chmod 600 $file"
fi
}
diff --git a/tests/test_last_run_state.py b/tests/test_last_run_state.py
index 505dbd9b..c44fdf94 100644
--- a/tests/test_last_run_state.py
+++ b/tests/test_last_run_state.py
@@ -6,7 +6,6 @@ import shutil
import stat
import subprocess
import sys
-import shutil
import tempfile
import unittest
from contextlib import redirect_stderr
@@ -294,7 +293,7 @@ class TestCheckPermsAutoFix(unittest.TestCase):
)
self.assertEqual(result.returncode, 0, result.stderr)
- self.assertIn("Auto-fixed", result.stdout)
+ self.assertIn("auto-fixed", result.stdout.lower())
self.assertEqual(stat.S_IMODE(os.stat(env_file).st_mode), 0o600)