Skip to content

Conversation

@joshrandall8478
Copy link

This aims to fix issue #813 with ouch prompting to overwrite the destination directory, in turn deleting files in the destination, despite no conflicts. This stems from a logic issue on line 324 in decompress.rs.

It now runs the following checks:

  • If output_dir does not exist, it's valid and will be created
  • If output_dir exists AND is a directory, it's valid and will be used (even if non-empty)
  • If output_dir exists AND is a file, there is a conflict and will ask the user.
let is_valid_output_dir = !output_dir.exists() || output_dir.is_dir();

@joshrandall8478
Copy link
Author

Some tests may need to be updated to match new behavior. I am open to contributions / suggestions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant