Skip to content

Add --force/--overwrite flag for --save-script now that publish refuses any existing target #1258

Description

@thymikee

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions