fix: user config retrival on linux
This commit is contained in:
@@ -24,10 +24,13 @@ pub fn get_osu_user_config<P: AsRef<Path>>(
|
||||
return None;
|
||||
}
|
||||
|
||||
let current_user = std::env::var("USERNAME").unwrap_or_else(|_| "Admin".to_string());
|
||||
let current_user = std::env::var("USERNAME")
|
||||
.or_else(|_| std::env::var("USER"))
|
||||
.unwrap_or_else(|_| "Admin".to_string());
|
||||
let osu_config_path = osu_folder_path
|
||||
.as_ref()
|
||||
.join(format!("osu!.{}.cfg", current_user));
|
||||
println!("Looking for user config at: {:?}", osu_config_path);
|
||||
if !osu_config_path.exists() {
|
||||
return None;
|
||||
}
|
||||
@@ -310,7 +313,9 @@ pub async fn is_net8_installed() -> bool {
|
||||
}
|
||||
|
||||
let stdout_str = String::from_utf8_lossy(&output.stdout);
|
||||
stdout_str.lines().any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
|
||||
stdout_str
|
||||
.lines()
|
||||
.any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
|
||||
}
|
||||
Err(_) => false,
|
||||
}
|
||||
@@ -385,4 +390,4 @@ pub fn encrypt_password(password: &str, entropy: &str) -> Result<String, String>
|
||||
let base64_string = general_purpose::STANDARD.encode(&encrypted_data);
|
||||
|
||||
Ok(base64_string)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user