Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
afujiwara-roblox committed Mar 5, 2024
1 parent 9440995 commit faf485a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ fn get_artiaa_path_based_on_os() -> ForemanResult<PathBuf> {
})?;

if let Ok(xdg_data_home) = env::var("XDG_DATA_HOME") {
return Ok(PathBuf::from(format!("{}/artiaa-tokens.json", xdg_data_home)));
return Ok(PathBuf::from(format!(
"{}/artiaa-tokens.json",
xdg_data_home
)));
} else if let Ok(home) = env::var("HOME") {
return Ok(PathBuf::from(format!("{}/.local/share/artiaa-tokens.json", home)));
return Ok(PathBuf::from(format!(
"{}/.local/share/artiaa-tokens.json",
home
)));
} else {
return Err(ForemanError::EnvVarNotFound {
env_var: "$HOME".to_string(),
Expand Down

0 comments on commit faf485a

Please sign in to comment.