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

'smart unpack' sometimes chooses an illogical name for the directory #443

Closed
NiceGuyIT opened this issue Jun 11, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@NiceGuyIT
Copy link

Version

ouch 0.4.1

Description

Sometimes ouch doesn't choose a good name for the Smart Unpack feature. This seems to happen with filenames with underscores. It doesn't have this problem with filenames with dashes -.

Current Behavior

$ curl --location --remote-name https://github.com/mr-karan/doggo/releases/download/v0.5.5/doggo_0.5.5_darwin_amd64.tar.gz
$ ouch decompress doggo_0.5.5_darwin_amd64.tar.gz
$ ls -l
total 7604
drwxr-x---  3 dev users      91 Jun 11 18:23 doggo_0.5
-rw-r-----  1 dev users 7785828 Jun 11 18:23 doggo_0.5.5_darwin_amd64.tar.gz
$ curl --location --remote-name https://github.com/go-acme/lego/releases/download/v4.12.1/lego_v4.12.1_linux_amd64.tar.gz
$ ouch decompress lego_v4.12.1_linux_amd64.tar.gz
$ ls -l
total 17064
drwxr-x---  2 dev users       53 Jun 11 18:33 lego_v4.12
-rw-r-----  1 dev users 17472889 Jun 11 18:33 lego_v4.12.1_linux_amd64.tar.gz

Expected Behavior

I expect the filename minus the compression extensions would be used.

$ curl --location --remote-name https://github.com/mr-karan/doggo/releases/download/v0.5.5/doggo_0.5.5_darwin_amd64.tar.gz
$ ouch decompress doggo_0.5.5_darwin_amd64.tar.gz
$ ls -l
total 7604
drwxr-x---  3 dev users      91 Jun 11 18:23 doggo_0.5.5_darwin_amd64
-rw-r-----  1 dev users 7785828 Jun 11 18:23 doggo_0.5.5_darwin_amd64.tar.gz
$ curl --location --remote-name https://github.com/go-acme/lego/releases/download/v4.12.1/lego_v4.12.1_linux_amd64.tar.gz
$ ouch decompress lego_v4.12.1_linux_amd64.tar.gz
$ ls -l
total 17064
drwxr-x---  2 dev users       53 Jun 11 18:33 lego_v4.12.1_linux_amd64
-rw-r-----  1 dev users 17472889 Jun 11 18:33 lego_v4.12.1_linux_amd64.tar.gz

Additional Information

No response

@NiceGuyIT NiceGuyIT added the bug Something isn't working label Jun 11, 2023
@figsoda
Copy link
Member

figsoda commented Jul 21, 2023

Could you test if this is still reproducible on the main branch? #355 should be able to fix this

@NiceGuyIT
Copy link
Author

That works. Thanks!

$ ~/projects/github/ouch/target/debug/ouch decompress doggo_0.5.5_darwin_amd64.tar.gz
[INFO] Could not detect the extension of `doggo_0.5.5_darwin_amd64`
[INFO] Created temporary directory /Users/dev/tmp/./.tmpxauw26 to hold decompressed elements.
[INFO] ".tmpxauw26/LICENSE" extracted. (34.33KiB)
[INFO] ".tmpxauw26/README.md" extracted. (8.59KiB)
[INFO] ".tmpxauw26/completions/doggo.fish" extracted. (1.81KiB)
[INFO] ".tmpxauw26/completions/doggo.zsh" extracted. (879B)
[INFO] ".tmpxauw26/doggo" extracted. (10.23MiB)
[INFO] ".tmpxauw26/doggo-api.bin" extracted. (9.03MiB)
[INFO] Successfully moved /Users/dev/tmp/./.tmpxauw26 to ./doggo_0.5.5_darwin_amd64.
[INFO] Successfully decompressed archive in current directory.
[INFO] Files unpacked: 6

$ ls -l
total 7832
drwxr-x---   7 dev staff      224 Jul 21 20:06 doggo_0.5.5_darwin_amd64
-rw-r-----   1 dev staff  7785828 Jul 21 20:06 doggo_0.5.5_darwin_amd64.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants