macOS Support (#18)

* replace target_os = "linux" with target_family = "unix"

* check correct dir for macos steam files
This commit is contained in:
Ankush Gupta
2022-03-10 06:21:28 +01:00
committed by GitHub
parent f77f1e6bab
commit c188c6f385
16 changed files with 40 additions and 28 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ impl Platform<ItchGame, ItchErrors> for ItchPlatform {
Ok(res)
}
#[cfg(target_os = "linux")]
#[cfg(target_family = "unix")]
fn create_symlinks(&self) -> bool {
self.settings.create_symlinks
}
@@ -92,7 +92,7 @@ fn dbpath_to_game(paths: &DbPaths<'_>) -> Option<ItchGame> {
})
}
#[cfg(target_os = "linux")]
#[cfg(target_family = "unix")]
pub fn get_default_location() -> String {
//If we don't have a home drive we have to just die
let home = std::env::var("HOME").expect("Expected a home variable to be defined");
+1 -1
View File
@@ -4,6 +4,6 @@ use serde::{Deserialize, Serialize};
pub struct ItchSettings {
pub enabled: bool,
pub location: Option<String>,
#[cfg(target_os = "linux")]
#[cfg(target_family = "unix")]
pub create_symlinks: bool,
}