Commit 5a4cd62
fix(init): restore first-run overwrite of README/CHANGELOG (#17)
The c6a35cf guard against overwriting customized README.md/CHANGELOG.md
on re-runs broke the first-run flow. On the un-initialized template,
both the template-facing *.md files AND their *.template.md sources are
present — file presence alone can't distinguish "first init" from
"re-init with template files reappearing." The guard fired on first
init, leaving the template-facing README.md/CHANGELOG.md in place AND
leaving CHANGELOG.template.md on disk, which then makes downstream CI
read is_template=true and skip every job on the user's brand-new module.
Use the existing $templateModuleFolder check as the disambiguator: if
{{ModuleName}}/ existed at script start, this is a first run and
overwrite is correct; if it didn't, the user already initialized once
and is re-running, so preserve any customized destination. Restore
-Force on Move-Item since the first-run path now legitimately needs to
overwrite the template-facing files.
Smoke test on a fresh worktree of main with this fix verifies:
- README.md / CHANGELOG.md replaced with module-facing content
- README.template.md / CHANGELOG.template.md removed from disk
- workflow guard sees is_template=false on the resulting module
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c8f5586 commit 5a4cd62
1 file changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | | - | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
| |||
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
285 | | - | |
286 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
287 | 294 | | |
288 | 295 | | |
289 | 296 | | |
290 | | - | |
| 297 | + | |
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
294 | | - | |
| 301 | + | |
295 | 302 | | |
296 | 303 | | |
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
301 | | - | |
| 308 | + | |
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | | - | |
| 312 | + | |
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
309 | | - | |
| 316 | + | |
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
| |||
0 commit comments