diff --git a/README.org b/README.org index 244ab5c..92e6229 100644 --- a/README.org +++ b/README.org @@ -205,6 +205,7 @@ fn set_member(config_path: String, tf_members: &[String]) -> Result<(), &'static let fronters = get_fronters(&config["pk_key"].as_str().unwrap(), &config["sp_key"].as_str().unwrap(), &system); pk_set_fronters(&config["pk_key"].as_str().unwrap(), &system, to_front, &fronters); } + get(config_path); Ok(()) } @@ -220,6 +221,20 @@ fn memberlist(config_path: String) { } } + +fn get(config_path: String) { + let config = get_config(&config_path); + let sys = get_system(&config_path); + + let f = get_fronters(&config["pk_key"].as_str().unwrap(), &config["sp_key"].as_str().unwrap(), &sys); + let mut names = Vec::new(); + for m in &f["pk"] { + names.push(String::from(&m.name)); + } + let fronters = names.join(" || "); + println!("Currently fronting: {}", fronters); + let _ = fs::write(format!("{}/.front", config_path), fronters); +} #+end_src ***** Memberlist diff --git a/src/main.rs b/src/main.rs index 15040ab..dec31f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -165,6 +165,7 @@ fn set_member(config_path: String, tf_members: &[String]) -> Result<(), &'static let fronters = get_fronters(&config["pk_key"].as_str().unwrap(), &config["sp_key"].as_str().unwrap(), &system); pk_set_fronters(&config["pk_key"].as_str().unwrap(), &system, to_front, &fronters); } + get(config_path); Ok(()) } @@ -190,7 +191,7 @@ fn get(config_path: String) { for m in &f["pk"] { names.push(String::from(&m.name)); } - let fronters = names.join(" | "); + let fronters = names.join(" || "); println!("Currently fronting: {}", fronters); let _ = fs::write(format!("{}/.front", config_path), fronters); }