fix(install): harden Claude settings lifecycle

This commit is contained in:
wellkilo
2026-09-07 01:57:04 +08:00
parent 26d3e0038b
commit f59cfd57c2
19 changed files with 540 additions and 350 deletions
+2 -16
View File
@@ -182,14 +182,7 @@ function runTests() {
target: 'claude',
moduleIds: ['hooks-runtime'],
});
const plan = {
...rawPlan,
hookConsent: 'enabled',
statePreview: {
...rawPlan.statePreview,
request: { ...rawPlan.statePreview.request, hookConsent: 'enabled' },
},
};
const plan = withHookConsent(rawPlan, 'enabled');
const settingsPath = path.join(homeDir, '.claude', 'settings.json');
applyInstallPlanDirect(plan, {
@@ -584,14 +577,7 @@ function runTests() {
target: 'claude',
moduleIds: ['hooks-runtime'],
});
const plan = {
...rawPlan,
hookConsent: 'enabled',
statePreview: {
...rawPlan.statePreview,
request: { ...rawPlan.statePreview.request, hookConsent: 'enabled' },
},
};
const plan = withHookConsent(rawPlan, 'enabled');
const settingsPath = path.join(homeDir, '.claude', 'settings.json');
let settingsCommitCount = 0;
fs.renameSync = function failAttributionCommit(sourcePath, destinationPath) {