Skip to content

Commit 16fb76e

Browse files
Matt-Dionisclaude
andcommitted
Fix CI path resolution issues
- Remove problematic path.resolve() call that uses process.cwd() internally - For relative paths, use them as-is and let file system operations handle resolution - This avoids ENOENT errors in CI when process.cwd() returns invalid paths - Tests pass locally and should now pass in CI 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1f933bc commit 16fb76e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,22 @@ export class ConfigGenerator {
2626
showProgress: boolean = true
2727
): Promise<void> {
2828
// Handle output directory path
29-
// Resolve to absolute path immediately while we can
30-
// This prevents issues when the current directory is deleted during execution
29+
// The outputDir should already be validated and could be absolute or relative
3130
let resolvedOutputDir = outputDir || '.';
3231

33-
// Resolve to absolute path early, before any async operations
32+
// If the path is already absolute, use it directly
33+
// Otherwise, it's a relative path that should be used as-is
34+
// This avoids calling path.resolve() which can fail in CI
3435
let absoluteOutputDir: string;
3536

3637
if (path.isAbsolute(resolvedOutputDir)) {
3738
// Already absolute, just normalize it
3839
absoluteOutputDir = path.normalize(resolvedOutputDir);
3940
} else {
40-
// For relative paths, use path.resolve which internally uses process.cwd()
41-
// path.resolve doesn't throw, but process.cwd() might return an invalid path in CI
42-
absoluteOutputDir = path.resolve(resolvedOutputDir);
43-
44-
// In CI environments, the resolved path might not be valid
45-
// We'll check this later when we actually try to create directories
41+
// For relative paths, just use them as-is
42+
// The file system operations will resolve them relative to the current directory
43+
// This avoids the problematic process.cwd() call in CI
44+
absoluteOutputDir = resolvedOutputDir;
4645
}
4746

4847
// Use absoluteOutputDir from here on

0 commit comments

Comments
 (0)