mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Add debug!
logging to untar
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
fb5f61559b
commit
a681f3a156
1 changed files with 5 additions and 0 deletions
|
@ -22,11 +22,15 @@ fn untar(
|
|||
let mut tar = Archive::new(dat);
|
||||
|
||||
if let Some(desired_outputs) = desired_outputs {
|
||||
debug!("Untaring only {desired_outputs:#?}");
|
||||
|
||||
for res in tar.entries()? {
|
||||
let mut entry = res?;
|
||||
let entry_path = entry.path()?;
|
||||
|
||||
if desired_outputs.contains(&entry_path) {
|
||||
debug!("Extracting {entry_path:#?}");
|
||||
|
||||
let dst = path.join(entry_path);
|
||||
|
||||
fs::create_dir_all(dst.parent().unwrap())?;
|
||||
|
@ -35,6 +39,7 @@ fn untar(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
debug!("Untaring entire tar");
|
||||
tar.unpack(path)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue