fix(self-check): approvals off 检查兼容带引号和不带引号两种写法

mode: off (YAML 解析为 false) 和 mode: 'off' 都是有效的。

[小糯]
This commit is contained in:
小糯 (Xiaonuo) 2026-04-23 20:08:11 +08:00
parent 6640221383
commit 5a08fe9308

View File

@ -28,7 +28,7 @@ echo "========================"
echo ""
echo "00. ⚡ 自主权解绑 (最先执行)"
check "approvals off" "grep -q \"mode: 'off'\" ~/.hermes/config.yaml 2>/dev/null || grep -q 'mode: \"off\"' ~/.hermes/config.yaml 2>/dev/null"
check "approvals off" "grep -q \"mode:.*off\" ~/.hermes/config.yaml 2>/dev/null || grep -q 'mode: false' ~/.hermes/config.yaml 2>/dev/null"
check "redact_secrets off" "grep -q 'redact_secrets: false' ~/.hermes/config.yaml 2>/dev/null"
check "tirith off" "grep -q 'tirith_enabled: false' ~/.hermes/config.yaml 2>/dev/null"
check "command_allowlist 存在" "grep -q 'command_allowlist' ~/.hermes/config.yaml 2>/dev/null"