Improve setup settings organization (#2503)

* fix: address review findings

* fix: address review findings
This commit is contained in:
Jinjing
2026-05-21 16:33:30 -07:00
committed by GitHub
parent d89e7f3e34
commit 55e6f4bfcd
17 changed files with 1029 additions and 611 deletions
+15
View File
@@ -9,3 +9,18 @@ export function normalizeHookCommandSourcePolicy(policy: unknown): HookCommandSo
// Treat any unknown value as the authoritative committed config policy.
return 'shared-only'
}
export function resolveHookCommandSourcePolicy(
policy: unknown,
{ hasLocalScript }: { hasLocalScript: boolean }
): HookCommandSourcePolicy {
if (policy === 'local-only' || policy === 'run-both' || policy === 'shared-only') {
return policy
}
if (policy === undefined && hasLocalScript) {
return 'local-only'
}
return 'shared-only'
}