Skip to content

[UX] Add confirmation prompt before overwriting existing files during unpack #5

@aarchiev

Description

@aarchiev

Problem

Currently, the unpack command silently overwrites existing files/directories if they share the same name as the archived content. This could lead to accidental data loss.

Solution

  1. Check if the output file/directory exists before writing.
  2. If it exists, prompt the user: File 'xyz' already exists. Overwrite? (y/N).
  3. Add a --force or -f flag to bypass this check for scripts.

Relevant Code

In main.rs, specifically inside the unpack function where File::create or tar::Archive::unpack is called.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions