search directory that the executable is in for maFiles (#277)

closes #275
This commit is contained in:
Carson McManus 2023-07-05 06:28:13 -04:00 committed by GitHub
parent d3b9471e95
commit a2b3f18d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -301,10 +301,13 @@ fn get_selected_accounts(
}
fn get_mafiles_dir() -> String {
let paths = vec![
let mut paths = vec![
Path::new(&dirs::config_dir().unwrap()).join("steamguard-cli/maFiles"),
Path::new(&dirs::home_dir().unwrap()).join("maFiles"),
];
if let Ok(current_exe) = std::env::current_exe() {
paths.push(current_exe.parent().unwrap().join("maFiles"));
}
for path in &paths {
if path.join("manifest.json").is_file() {