What happens to your manual edits when you run a code generator again?
说明与用途
在重新运行 Jostraca 时,手动编辑可能会被删除、保留或合并。覆盖模式会删除编辑;合并模式在更改位于不同行时保留编辑。
问题
When a code generator is rerun, manual edits to generated files may be lost, preserved, or merged, leading to uncertainty about file consistency.
结果
Jostraca correctly implements both overwrite and merge behaviors as documented. Overwrite removes manual edits; merge preserves them when changes are on different lines.
工作流
- Generate initial file with Jostraca.
- Manually edit the file (add DEBUG=1).
- Re-run generator with overwrite policy (write:true, merge:false).
- Re-run generator with merge policy (write:true, merge:true).
证据
I tested version 0.39.0 with a small configuration file, comparing overwrite and merge behaviour after adding a manual change. Both cases worked as documented.
After regeneration: PORT=9090 HOST=localhost
The resulting file contained: PORT=9090 HOST=localhost DEBUG=1
The documentation describes a three-way merge using the previous generated version as a baseline.
- 记录日期: 2026-10-14T13:41:05.662Z