Skip to content

Commit

Permalink
adding spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
mckernant1 committed Sep 6, 2019
1 parent 7e4f0d9 commit bc351ce
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 10 deletions.
117 changes: 116 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pm"
version = "0.3.0"
version = "0.3.1"
authors = ["Tom McKernan <tmeaglei@gmail.com>"]
edition = "2018"

Expand All @@ -9,3 +9,4 @@ edition = "2018"
[dependencies]
clap = {version = "~2.33.0", features = ["yaml"]}
json = "0.11.15"
spinners = "1.0.0"
2 changes: 1 addition & 1 deletion src/cli.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Project Manager
version: 0.3.0
version: 0.3.1
author: Tom McKernan <tmeaglei@gmail.com>
about: A project manager for your computer
subcommands:
Expand Down
14 changes: 7 additions & 7 deletions src/subcommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::path::PathBuf;
use std::fs;
use std::io::{stdout, Write, stdin};
use json::JsonValue;
use spinners::{Spinner, Spinners};

pub fn clone(matches: ArgMatches, settings_file: SettingsFile) {
let repo_string = matches
Expand Down Expand Up @@ -47,18 +48,17 @@ pub fn pull(matches: ArgMatches, settings_file: SettingsFile) {
println!("Done pulling: {}", repo_name)
} else {
let mut child_list: Vec<_> = vec![];
let spinner = Spinner::new(Spinners::Dots, "Pulling all repos...".into());
for member in repos.members() {
println!("Pulling: {}", member["name"].clone().to_string());
child_list.push((
member["name"].to_string(),
child_list.push(
exec_git(vec!["-C", member["path"].as_str().unwrap(), "pull"], Option::None, Option::None)
))
)
}
for child_pair in child_list {
let (child_name, mut child) = child_pair;
for mut child in child_list {
child.wait().unwrap();
println!("Done pulling: {}", child_name)
}
spinner.stop();
println!("\nDone!")
}
}

Expand Down

0 comments on commit bc351ce

Please sign in to comment.