Skip to content

Silently overwrites an existing output file; add a guard / --force #4

Description

@Sdaas

Problem

Each strategy runs rm -f "$OUTPUT_FILE" before writing (decrypt-pdf:313, :335, :357, ...). If a file already exists at the output path — including the default <input>_decrypted.pdf — it is deleted and replaced without any warning or confirmation. An accidental name clash (or a re-run) can silently destroy an unrelated file.

Suggested fix

  • If OUTPUT_FILE already exists (and is not the input), refuse with a clear error and non-zero exit, unless the user passes --force.
  • Document the behavior in --help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions