forked from DGNum/colmena
parent
b751209f60
commit
e5665775b2
5 changed files with 27 additions and 8 deletions
|
@ -379,10 +379,15 @@ impl Deployment {
|
|||
}
|
||||
};
|
||||
|
||||
let build_elapsed = bar.get_elapsed();
|
||||
bar.success_quiet();
|
||||
|
||||
if goal == Goal::Build {
|
||||
for (node, profile) in profiles.iter() {
|
||||
let bar = progress.create_task_progress(node.to_string());
|
||||
let mut bar = progress.create_task_progress(node.to_string());
|
||||
if let Some(elapsed) = build_elapsed {
|
||||
bar.set_elapsed(elapsed);
|
||||
}
|
||||
bar.success(&format!("Built {:?}", profile.as_path()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use std::future::Future;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use atty::Stream;
|
||||
use console::Style;
|
||||
|
@ -192,6 +193,18 @@ impl TaskProgress {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the time spent on this task so far.
|
||||
pub fn get_elapsed(&self) -> Option<Duration> {
|
||||
self.bar.as_ref().map(|bar| bar.elapsed())
|
||||
}
|
||||
|
||||
/// Sets the time spent on this task so far.
|
||||
pub fn set_elapsed(&mut self, elapsed: Duration) {
|
||||
if let Some(bar) = self.bar.take() {
|
||||
self.bar.replace(bar.with_elapsed(elapsed));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn failure_err<E: std::error::Error>(self, error: &E) {
|
||||
self.failure(&error.to_string())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue