Skip to content

Commit

Permalink
Fixed local install search paths on Linux.
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
Arnavion committed Jun 25, 2017
1 parent 476a27d commit c6daa8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion factorio-mods-local/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ lazy_static! {

if let Ok(user_data_dir) = ::appdirs::user_data_dir(Some("Steam"), None, false) {
let mut steam_directory = user_data_dir;
steam_directory.push("SteamApps");
steam_directory.push("steamapps");
steam_directory.push("common");
steam_directory.push("Factorio");
if steam_directory.is_dir() {
Expand All @@ -201,6 +201,14 @@ lazy_static! {
result.push(::std::path::PathBuf::from(r"C:\Program Files (x86)\Steam\steamapps\common\Factorio"));
}

if cfg!(target_os = "linux") {
if let Some(home) = ::std::env::var_os("HOME") {
let home_directory = ::std::path::Path::new(&home);
result.push(home_directory.join("factorio"));
result.push(home_directory.join(".factorio"));
}
}

result
};
}
Expand Down

0 comments on commit c6daa8f

Please sign in to comment.