1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Tick after creating progress bar to draw it

This commit is contained in:
ctsk 2022-12-05 17:51:58 +01:00
parent 42b9b7b62c
commit 8a837dae21

View file

@ -971,16 +971,16 @@ fn copy(sources: &[Source], target: &TargetSlice, options: &Options) -> CopyResu
let mut symlinked_files = HashSet::new();
let progress_bar = if options.progress_bar {
Some(
ProgressBar::new(disk_usage(sources, options.recursive)?)
.with_style(
ProgressStyle::with_template(
"{msg}: [{elapsed_precise}] {wide_bar} {bytes:>7}/{total_bytes:7}",
)
.unwrap(),
let pb = ProgressBar::new(disk_usage(sources, options.recursive)?)
.with_style(
ProgressStyle::with_template(
"{msg}: [{elapsed_precise}] {wide_bar} {bytes:>7}/{total_bytes:7}",
)
.with_message(uucore::util_name()),
)
.unwrap(),
)
.with_message(uucore::util_name());
pb.tick();
Some(pb)
} else {
None
};