Skip to content

Commit d32a187

Browse files
**(cli):** Fixed an issue where alpha generate skipped files and directories beginning with a dot (e.g., .github/, .env, .golangci.yaml). These are now properly removed during cleanup, except .git and PROJECT, which are intentionally preserved.
1 parent 72a5ab5 commit d32a187

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/cli/alpha/internal/generate.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ func (opts *Generate) Generate() error {
7171
log.Error("Cleanup failed:", err)
7272
return fmt.Errorf("cleanup failed: %w", err)
7373
}
74+
75+
// Note that we should remove ALL files except the PROJECT file and .git directory
76+
cleanupCmd = fmt.Sprintf(
77+
`find %q -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'PROJECT' -exec rm -rf {} +`,
78+
opts.OutputDir,
79+
)
80+
err = util.RunCmd("Running cleanup", "sh", "-c", cleanupCmd)
81+
if err != nil {
82+
log.Error("Cleanup failed:", err)
83+
return fmt.Errorf("cleanup failed: %w", err)
84+
}
7485
}
7586
}
7687

0 commit comments

Comments
 (0)