Skip to content

Commit 095ce7d

Browse files
Matt-Dionisclaude
andcommitted
Fix CI test failures by skipping hooks.json special file
The nextjs-15 configuration contains a hooks.json file which is a special configuration file for defining hooks, not a regular hook script. The generator was incorrectly trying to write it as a regular file, causing ENOENT errors in CI tests. This fix adds logic to skip hooks.json when processing hooks, preventing the directory creation failures that were causing tests to fail in CI. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5a72e93 commit 095ce7d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

claude-config-composer/src/generator/config-generator.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ export class ConfigGenerator {
168168
const mergedHooks = this.componentMerger.mergeHooks(hookGroups);
169169

170170
// Process hooks (directory already created above)
171+
let writtenHooksCount = 0;
171172
for (const hook of mergedHooks) {
173+
// Skip hooks.json as it's a special configuration file that shouldn't be copied
174+
if (hook.name === 'hooks.json') {
175+
continue;
176+
}
177+
172178
// Validate and sanitize hook data
173179
const validatedHook = InputValidator.validateHook(hook);
174180
const hookName =
@@ -177,8 +183,9 @@ export class ConfigGenerator {
177183
// Write directly to hooksDir
178184
const hookPath = path.join(hooksDir, hookName);
179185
await fs.writeFile(hookPath, hookContent);
186+
writtenHooksCount++;
180187
}
181-
if (spinner) spinner.text = `${steps[currentStep]} (${mergedHooks.length} hooks)`;
188+
if (spinner) spinner.text = `${steps[currentStep]} (${writtenHooksCount} hooks)`;
182189
if (spinner) spinner.succeed();
183190

184191
// Merge and write settings.json to .claude/

0 commit comments

Comments
 (0)