mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-15 07:36:50 +03:00
Preserve detector extensions
AI assistance: Codex addressed review feedback and validated this follow-up under maintainer authorization.
This commit is contained in:
@@ -223,7 +223,11 @@ function writeHookConfig(cwd, hookConfig, opts = {}) {
|
||||
// (consent, quiet, auditLog) survive an Impeccable hooks edit.
|
||||
const next = { ...existing, hook: { ...existingHook, ...hookConfig } };
|
||||
if (Object.keys(legacyDetector).length > 0) {
|
||||
next.detector = mergeDetectorConfig(detectorSection(existing), mergeDetectorConfig(legacyDetector));
|
||||
const existingDetector = detectorSection(existing) || {};
|
||||
next.detector = {
|
||||
...existingDetector,
|
||||
...mergeDetectorConfig(existingDetector, mergeDetectorConfig(legacyDetector)),
|
||||
};
|
||||
}
|
||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
fs.writeFileSync(filePath, JSON.stringify(next, null, 2) + '\n');
|
||||
|
||||
Reference in New Issue
Block a user