Skip to content

Commit

Permalink
Fix: Xz archive extraction error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Feb 10, 2023
1 parent 9c745d5 commit 345081f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ pub async fn install_package(
.await
.context("Failed to open downloaded file")?;

let copy_task = if *format == ArchiveFormat::TarGz {
io::copy(&mut dl_file, &mut GzipDecoder::new(&mut tar_file)).await
if *format == ArchiveFormat::TarGz {
io::copy(&mut dl_file, &mut GzipDecoder::new(&mut tar_file))
.await
.context("Failed to extract GZip archive")?
} else {
io::copy(&mut dl_file, &mut XzDecoder::new(&mut tar_file)).await
io::copy(&mut dl_file, &mut XzDecoder::new(&mut tar_file))
.await
.context("Failed to extract Xz archive")?
};

copy_task.context("Failed to extract GZip archive")?;

on_message("Analyzing tarball archive...");

let tar_file = File::open(&tar_file_path)
Expand Down

0 comments on commit 345081f

Please sign in to comment.