ouch
ouch copied to clipboard
Improve unpacking output when creating an empty directory
Creating a directory when you're...
unpacking a zip archive:
[INFO] File 12 extracted to "/home/marcospb19/ouch/testing/.tmpmiVaZQ/src/commands/"
unpacking a tar (tar.gz.*) archive:
[INFO] "testing/.tmpcBIpss/src/commands" extracted. (0 B)
The output of both lines should be identical.
For this, we can have a message like "Directory \"...\" created.".
To check if a tar entry is a directory, you can call file.header.entry_type for a tar Entry, here:
https://github.com/ouch-org/ouch/blob/5a97029bde1d0099059e0f0e6d92a82cb9266f4a/src/archive/tar.rs#L31
and check https://docs.rs/tar/latest/tar/enum.EntryType.html#variant.Directory with .is_dir().