From a2b3f18d768550126b93008172a818001faeaef9 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 5 Jul 2023 06:28:13 -0400 Subject: [PATCH] search directory that the executable is in for maFiles (#277) closes #275 --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 832f8a6..cbc624f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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() {