parent
b751209f60
commit
e5665775b2
5 changed files with 27 additions and 8 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -174,6 +174,7 @@ dependencies = [
|
|||
"encode_unicode",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"regex",
|
||||
"terminal_size",
|
||||
"winapi",
|
||||
]
|
||||
|
@ -370,12 +371,11 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
|
|||
[[package]]
|
||||
name = "indicatif"
|
||||
version = "0.17.0-beta.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "500f7e5a63596852b9bf7583fe86f9ad08e0df9b4eb58d12e9729071cb4952ca"
|
||||
source = "git+https://github.com/mitsuhiko/indicatif?rev=5a38ab70b75be5fc9f4a00c4d9d58adabb817398#5a38ab70b75be5fc9f4a00c4d9d58adabb817398"
|
||||
dependencies = [
|
||||
"console 0.15.0",
|
||||
"lazy_static",
|
||||
"number_prefix",
|
||||
"once_cell",
|
||||
"regex",
|
||||
]
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ env_logger = "0.8.2"
|
|||
futures = "0.3.8"
|
||||
glob = "0.3.0"
|
||||
hostname = "0.3.1"
|
||||
indicatif = "0.17.0-beta.1"
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2.81"
|
||||
log = "0.4.11"
|
||||
|
@ -32,6 +31,10 @@ tokio-test = "0.4.0"
|
|||
users = "0.11.0"
|
||||
validator = { version = "0.12", features = ["derive"] }
|
||||
|
||||
# For https://github.com/mitsuhiko/indicatif/pull/325
|
||||
# Change back to 0.17.0-beta.2 when it releases
|
||||
indicatif = { git = "https://github.com/mitsuhiko/indicatif", rev = "5a38ab70b75be5fc9f4a00c4d9d58adabb817398" }
|
||||
|
||||
[dependencies.tokio]
|
||||
version = "1.0.0"
|
||||
features = [
|
||||
|
|
|
@ -19,9 +19,7 @@ in rustPlatform.buildRustPackage {
|
|||
src = lib.cleanSource ./.;
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
cargoSha256 = "sha256-JDJQnKO0j1DegOyuZi3WU4wVnotucSVPbwbn25R8Jb8=";
|
||||
|
||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
||||
mkdir completions
|
||||
|
|
|
@ -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…
Reference in a new issue