dl-utils: use wide_msg everywhere for truncation on narrow terminals

This commit is contained in:
Trent Nelson
2021-04-14 16:27:50 -06:00
committed by mergify[bot]
parent 143496ccba
commit e61b4b7d70
2 changed files with 10 additions and 19 deletions

View File

@ -74,15 +74,12 @@ pub fn download_file(
progress_bar.set_length(download_size);
progress_bar.set_style(
ProgressStyle::default_bar()
.template(&format!(
"{}{}Downloading {} {}",
"{spinner:.green} ",
TRUCK,
url,
"[{bar:40.cyan/blue}] {bytes}/{total_bytes} ({eta})"
))
.template(
"{spinner:.green}{msg_wide}[{bar:40.cyan/blue}] {bytes}/{total_bytes} ({eta})",
)
.progress_chars("=> "),
);
progress_bar.set_message(&format!("{}Downloading~ {}", TRUCK, url));
} else {
info!("Downloading {} bytes from {}", download_size, url);
}