Skip to content

Commit

Permalink
Print messages on non-interactive downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Dec 21, 2024
1 parent 70c8955 commit 7f74335
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/compiler/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,17 @@ impl<'a> Clang<'a> {
);
pb.set_prefix("sysroot");
pb.set_message("⏬ Downloading");
if pb.is_hidden() {
eprintln!("⏬ Start to download MSVC sysroot...");
}
let reader = pb.wrap_read(response.into_reader());
let tar = XzDecoder::new(reader);
let mut archive = tar::Archive::new(tar);
archive.unpack(cache_dir)?;
pb.finish_with_message("Download completed");
if pb.is_hidden() {
eprintln!("✅ Finished downloading MSVC sysroot");
}
Ok(())
}

Expand Down
6 changes: 6 additions & 0 deletions src/compiler/clang_cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ impl<'a> ClangCl<'a> {
.collect();

mp.set_move_cursor(true);
if mp.is_hidden() {
eprintln!("⏬ Start to download MSVC CRT...");
}
ctx.execute(
pkgs,
work_items,
Expand All @@ -335,6 +338,9 @@ impl<'a> ClangCl<'a> {
if unpack.exists() {
let _ = fs::remove_dir_all(unpack);
}
if mp.is_hidden() {
eprintln!("✅ Finished downloading MSVC CRT");
}
Ok(())
}

Expand Down

0 comments on commit 7f74335

Please sign in to comment.