Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ouch 0.4.0 incorrectly erases parent dir when using --dir . #336

Closed
vrmiguel opened this issue Jan 5, 2023 · 3 comments
Closed

ouch 0.4.0 incorrectly erases parent dir when using --dir . #336

vrmiguel opened this issue Jan 5, 2023 · 3 comments
Labels
bug Something isn't working urgent! Highest priority of them all

Comments

@vrmiguel
Copy link
Member

vrmiguel commented Jan 5, 2023

Version

0.4.0

Description

ouch d <archive> --dir . asks to overwrite . and, if the response is yes, completely deletes the contents of .

Current Behavior

No response

Expected Behavior

No response

Additional Information

This behavior has already been fixed in HEAD, likely by #330 (or #321 ?). We just need to release ouch 0.4.1 with this fix and the other smaller performance-related PRs as soon as possible

@vrmiguel vrmiguel added the bug Something isn't working label Jan 5, 2023
@vrmiguel vrmiguel changed the title ouch 0.4.0 correctly erases parent dir when using dir . ouch 0.4.0 correctly erases parent dir when using --dir . Jan 5, 2023
@vrmiguel vrmiguel added the urgent! Highest priority of them all label Jan 5, 2023
@vrmiguel
Copy link
Member Author

vrmiguel commented Jan 5, 2023

@figsoda @marcospb19

To reproduce

~ % cargo install ouch
~ % cd ouch 
ouch % ouch c src src.zip   
[INFO] Compressing 'src'.
[INFO] Compressing 'src/archive'.
[INFO] Compressing 'src/archive/tar.rs'.
[INFO] Compressing 'src/archive/mod.rs'.
[INFO] Compressing 'src/archive/zip.rs'.
[INFO] Compressing 'src/error.rs'.
[INFO] Compressing 'src/list.rs'.
[INFO] Compressing 'src/utils'.
[INFO] Compressing 'src/utils/question.rs'.
[INFO] Compressing 'src/utils/formatting.rs'.
[INFO] Compressing 'src/utils/mod.rs'.
[INFO] Compressing 'src/utils/colors.rs'.
[INFO] Compressing 'src/utils/file_visibility.rs'.
[INFO] Compressing 'src/utils/fs.rs'.
[INFO] Compressing 'src/accessible.rs'.
[INFO] Compressing 'src/main.rs'.
[INFO] Compressing 'src/commands'.
[INFO] Compressing 'src/commands/list.rs'.
[INFO] Compressing 'src/commands/decompress.rs'.
[INFO] Compressing 'src/commands/mod.rs'.
[INFO] Compressing 'src/commands/compress.rs'.
[INFO] Compressing 'src/opts.rs'.
[INFO] Compressing 'src/macros.rs'.
[INFO] Compressing 'src/extension.rs'.
[INFO] Compressing 'src/cli.rs'.
[INFO] Successfully compressed 'src.zip'.
ouch % ouch d src.zip --dir .
Do you want to overwrite '.'? [Y/n] y
[ERROR] failed to remove directory `.`
ouch % ls
ouch %

@figsoda
Copy link
Member

figsoda commented Jan 5, 2023

it was probably fixed by #321.
we should be good for a new release, might also want to add the performance inprovements to the changelog

btw in case you didn't see #309, we can now make releases just by creating a tag, github actions will automatically build and upload the artifacts to a draft release, and all we need to do is to write the release notes and publish it

@vrmiguel
Copy link
Member Author

vrmiguel commented Jan 5, 2023

Closing this since 0.4.1 has been published on GitHub and crates.io

@vrmiguel vrmiguel closed this as completed Jan 5, 2023
@marcospb19 marcospb19 changed the title ouch 0.4.0 correctly erases parent dir when using --dir . ouch 0.4.0 incorrectly erases parent dir when using --dir . Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent! Highest priority of them all
Projects
None yet
Development

No branches or pull requests

2 participants