Skip to content

Commit

Permalink
Adds ability to set name
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbrain-za committed Dec 10, 2023
1 parent c8715af commit 18526d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "judge"
version = "2.3.4"
version = "2.3.5"
edition = "2021"
authors = ["Philip Barlow"]
description = "Tool for an in house code challenge server"
Expand Down
4 changes: 0 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ impl WriteConfig {
};
}
"-n" => {
let user = whoami::username();
if user != "root" {
return Err("-n has been deprecated. Do not use anymore.".into());
}
name = Some(
args.get(i + 1)
.ok_or("-n must provide a string")?
Expand Down
15 changes: 9 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let config = match config::RunMode::from_args(&args) {
Ok(config) => config,
Err(_) => match menu::Menu::run(None) {
Ok(config) => config,
Err(e) => {
error!("Failed to establish run mode: {}", e);
return Ok(());
Err(e) => {
log::debug!("Failed to establish run mode: {}", e);
match menu::Menu::run(None) {
Ok(config) => config,
Err(e) => {
error!("Failed to establish run mode: {}", e);
return Ok(());
}
}
},
}
};
debug!("Config: {:?}", config);

Expand Down

0 comments on commit 18526d5

Please sign in to comment.