changed spinner stop

main
ad4mx 2 years ago
parent 809211f72c
commit 413f94a5eb

4
Cargo.lock generated

@ -485,9 +485,9 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]] [[package]]
name = "spinoff" name = "spinoff"
version = "0.4.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d3f754b5a185a81fa60acbd32f095411e276743d27307a531d34eae5d49c991" checksum = "01e1a863da0489c765f2642597c8d367a0a3939184b4775306d7fffdb455d952"
dependencies = [ dependencies = [
"maplit", "maplit",
"once_cell", "once_cell",

@ -29,7 +29,7 @@ colored = { version = "2.0.0", default-features = false }
tabled = { version = "0.8.0", default-features = false, features = ["derive", "color"] } tabled = { version = "0.8.0", default-features = false, features = ["derive", "color"] }
crossterm = { version = "0.24.0", default-features = false } crossterm = { version = "0.24.0", default-features = false }
regex = { version = "1.6.0", default-features = false, features = ["std"] } regex = { version = "1.6.0", default-features = false, features = ["std"] }
spinoff = { version = "0.4.0", default-features = false } spinoff = { version = "0.5.0", default-features = false }
rm_rf = { version = "0.6.2", default-features = false } rm_rf = { version = "0.6.2", default-features = false }
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]

@ -161,14 +161,8 @@ pub fn info(verbose: bool) {
.output() .output()
.unwrap(); .unwrap();
// Because spinoff requires &'static str, we need to Box these in the heap and then leak them to be able to format the spinner // Stop the spinner with a success message
let symbol = Box::new(format!("{}", "✔".bold().green())); sp.success("Done!");
let done = Box::new(format!("{}", "Done!".bold()));
let symbol: &'static str = Box::leak(symbol);
let done: &'static str = Box::leak(done);
sp.stop_and_persist(symbol, done);
log!(verbose, "Repos: {:?}", repos); log!(verbose, "Repos: {:?}", repos);
} }

Loading…
Cancel
Save