fix: user config retrival on linux

This commit is contained in:
2026-06-03 19:57:00 +02:00
parent 64f76d95a6
commit f8f53c4236
+8 -3
View File
@@ -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)
}
}