Skip to content

Commit

Permalink
disable progressbar for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
MordechaiHadad committed Jul 31, 2024
1 parent 5e662a6 commit 9c73489
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/helpers/unarchive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@ fn expand(downloaded_file: LocalVersion) -> Result<()> {
let mut archive = Archive::new(decompress_stream);

let totalsize = 1692; // hard coding this is pretty unwise, but you cant get the length of an archive in tar-rs unlike zip-rs
let pb = ProgressBar::new(totalsize);
pb.set_style(
ProgressStyle::default_bar()
.template(
"{msg}\n{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos}/{len}",
)
.progress_chars("█ "),
);
pb.set_message("Expanding archive");
// let pb = ProgressBar::new(totalsize);
// pb.set_style(
// ProgressStyle::default_bar()
// .template(
// "{msg}\n{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos}/{len}",
// )
// .progress_chars("█ "),
// );
// pb.set_message("Expanding archive");

let mut downloaded: u64 = 0;
let mut display = true;
Expand Down Expand Up @@ -344,15 +344,15 @@ fn expand(downloaded_file: LocalVersion) -> Result<()> {
}
let new = min(downloaded + 1, totalsize);
downloaded = new;
pb.set_position(new);
// pb.set_position(new);
}
Err(error) => println!("{error}"),
}
}
pb.finish_with_message(format!(
"Finished expanding to {}/{}",
downloaded_file.path, downloaded_file.file_name
));
// pb.finish_with_message(format!(
// "Finished expanding to {}/{}",
// downloaded_file.path, downloaded_file.file_name
// ));

let file = &format!("{}/bin/nvim", downloaded_file.file_name);
let mut perms = fs::metadata(file)?.permissions();
Expand Down

0 comments on commit 9c73489

Please sign in to comment.