fix: prefer explicit hook mappings

This commit is contained in:
Peter Steinberger
2026-01-03 05:09:54 +01:00
parent b417fe5727
commit 0ed5b82389

View File

@@ -114,11 +114,11 @@ export function resolveHookMappings(
): HookMappingResolved[] { ): HookMappingResolved[] {
const presets = hooks?.presets ?? []; const presets = hooks?.presets ?? [];
const mappings: HookMappingConfig[] = []; const mappings: HookMappingConfig[] = [];
if (hooks?.mappings) mappings.push(...hooks.mappings);
for (const preset of presets) { for (const preset of presets) {
const presetMappings = hookPresetMappings[preset]; const presetMappings = hookPresetMappings[preset];
if (presetMappings) mappings.push(...presetMappings); if (presetMappings) mappings.push(...presetMappings);
} }
if (hooks?.mappings) mappings.push(...hooks.mappings);
if (mappings.length === 0) return []; if (mappings.length === 0) return [];
const configDir = path.dirname(CONFIG_PATH_CLAWDIS); const configDir = path.dirname(CONFIG_PATH_CLAWDIS);