Follow-up to #1235. Publishing a script (--save-script, repair heals and ordinary recordings alike) now refuses if the target path already exists — a deliberate, uniform no-clobber (fails loudly instead of silently destroying a prior script; especially important for an agent that re-runs commands).
The one ergonomic cost is intentional re-recording/re-saving to the same path, which now requires removing the file first. Add an explicit escape hatch — --force (or --overwrite) on the record/save path — so a caller can opt into overwriting when they mean to. Keeps the safe default (refuse) while restoring redirect-like ergonomics for those who want them.
Scope: the flag + its wiring through open --save-script/close --save-script/replay --save-script and publishHealedScriptAtomically (which would renameSync-overwrite when --force is set). Small, additive.
Follow-up to #1235. Publishing a script (
--save-script, repair heals and ordinary recordings alike) now refuses if the target path already exists — a deliberate, uniform no-clobber (fails loudly instead of silently destroying a prior script; especially important for an agent that re-runs commands).The one ergonomic cost is intentional re-recording/re-saving to the same path, which now requires removing the file first. Add an explicit escape hatch —
--force(or--overwrite) on the record/save path — so a caller can opt into overwriting when they mean to. Keeps the safe default (refuse) while restoring redirect-like ergonomics for those who want them.Scope: the flag + its wiring through
open --save-script/close --save-script/replay --save-scriptandpublishHealedScriptAtomically(which wouldrenameSync-overwrite when--forceis set). Small, additive.