Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Categories Used:
- Support decompression of concatenated `.gz`, `.bz2`, and `.lz4` (https://github.com/ouch-org/ouch/pull/898)

### Improvements

- Give better error messages when archive extensions are invalid (https://github.com/ouch-org/ouch/pull/817)
- Improve misleading error message (https://github.com/ouch-org/ouch/pull/818)
- Add aliases for `--password` flag (`--pass` and `--pw`) (https://github.com/ouch-org/ouch/pull/847)
Expand All @@ -44,6 +43,7 @@ Categories Used:
- Refactor/simplify logger (https://github.com/ouch-org/ouch/pull/888)
- Print input and output file sizes (https://github.com/ouch-org/ouch/pull/914)
- Make path printing concise and consistent (https://github.com/ouch-org/ouch/pull/916)
- Unify directory extraction message for zip and tar archives (https://github.com/ouch-org/ouch/pull/937)

### Bug Fixes

Expand Down
14 changes: 9 additions & 5 deletions src/archive/tar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ pub fn unpack_archive(reader: impl Read, output_folder: &Path) -> Result<u64> {
_ => continue,
}

info!(
"extracted ({}) {:?}",
BytesFmt(file.size()),
PathFmt(&output_folder.join(file.path()?)),
);
if file.header().entry_type().is_dir() {
info!("Directory {:?} created", PathFmt(&output_folder.join(file.path()?)));
} else {
info!(
"extracted ({}) {:?}",
BytesFmt(file.size()),
PathFmt(&output_folder.join(file.path()?)),
);
}
files_unpacked += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/archive/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where

match file.name().ends_with('/') {
_is_dir @ true => {
info!("File {} extracted to {:?}", idx, PathFmt(&file_path));
info!("Directory {:?} created", PathFmt(&file_path));

let mode = file.unix_mode();
let is_symlink = mode.is_some_and(|mode| mode & 0o170000 == 0o120000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
source: tests/ui.rs
expression: "lines.join(\"\\n\")"
---
[INFO] Directory "output/input" created
[INFO] Files unpacked: 4
[INFO] Successfully decompressed archive to "output"
[INFO] extracted ( [SIZE]) "output/input"
[INFO] extracted ( [SIZE]) "output/input/input"
[INFO] extracted ( [SIZE]) "output/input/input2"
[INFO] extracted ( [SIZE]) "output/input/input3"
Loading