Skip to content

Commit aaa82ac

Browse files
committed
Missed from the prev commit #20
1 parent bc01cb0 commit aaa82ac

File tree

1 file changed

+5
-48
lines changed

1 file changed

+5
-48
lines changed

stackmuncher/src/main.rs

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::config::AppConfig;
2-
use crate::signing::ReportSignature;
32
use path_absolutize::{self, Absolutize};
43
use tracing::info;
54

65
mod app_args;
76
mod cmd_munch;
87
mod config;
8+
mod configure;
99
mod help;
1010
mod signing;
1111
mod submission;
@@ -60,11 +60,14 @@ async fn main() -> Result<(), ()> {
6060
make_anon();
6161
}
6262
app_args::AppArgCommands::ViewConfig => {
63-
view_config(config);
63+
configure::view_config(config).await;
6464
}
6565
app_args::AppArgCommands::Help => {
6666
help::emit_welcome_msg(config);
6767
}
68+
app_args::AppArgCommands::GitGHubConfig => {
69+
configure::github(config).await;
70+
}
6871
};
6972

7073
Ok(())
@@ -83,49 +86,3 @@ fn make_anon() {
8386
println!();
8487
println!(" Run `stackmuncher{} --public_name \"\" --public_contact \"\"` to remove your public details and make your profile anonymous.", std::env::consts::EXE_SUFFIX);
8588
}
86-
87-
/// A temporary stub for `view_config` command.
88-
fn view_config(config: AppConfig) {
89-
// prepare values needed in println!() macros to prevent line wrapping in the code
90-
let pub_key = ReportSignature::get_public_key(&config.user_key_pair);
91-
let reports = config
92-
.lib_config
93-
.report_dir
94-
.as_ref()
95-
.expect("config.report_dir is not set. It's a bug.")
96-
.absolutize()
97-
.expect("Cannot convert config.report_dir to absolute path. It's a bug.")
98-
.to_string_lossy()
99-
.to_string();
100-
let rules = config
101-
.lib_config
102-
.code_rules_dir
103-
.absolutize()
104-
.expect("Cannot convert config.code_rules_dir to absolute path. It's a bug.")
105-
.to_string_lossy()
106-
.to_string();
107-
let pub_contact = config
108-
.public_contact
109-
.as_ref()
110-
.unwrap_or(&"not set".to_owned())
111-
.to_string();
112-
let config_file = config
113-
.config_file_path
114-
.absolutize()
115-
.expect("Cannot convert config.config_file_path to absolute path. It's a bug.")
116-
.to_string_lossy()
117-
.to_string();
118-
119-
println!();
120-
println!(" Primary email: {}", config.primary_email.as_ref().unwrap_or(&"not set".to_owned()));
121-
println!(" Commit emails: {}", config.lib_config.git_identities.join(", "));
122-
println!();
123-
println!(" Public name: {}", config.public_name.as_ref().unwrap_or(&"not set".to_owned()));
124-
println!(" Public contact: {}", pub_contact);
125-
println!(" Directory profile: https://stackmuncher.com/?dev={}", pub_key);
126-
println!();
127-
println!(" Local stack reports: {}", reports);
128-
println!(" Code analysis rules: {}", rules);
129-
println!(" Config file: {}", config_file);
130-
println!();
131-
}

0 commit comments

Comments
 (0)