cli don't panic of no HOME env var

This commit is contained in:
mbecker20
2024-08-11 02:26:18 -07:00
parent 5800fc91d2
commit d4fc015494

View File

@@ -32,8 +32,8 @@ pub struct CliArgs {
}
fn default_creds() -> String {
let home = std::env::var("HOME")
.expect("no HOME env var. cannot get default config path.");
let home =
std::env::var("HOME").unwrap_or_else(|_| String::from("/root"));
format!("{home}/.config/monitor/creds.toml")
}