Skip to content

Commit

Permalink
fix cfgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kesomannen committed Aug 8, 2024
1 parent 7ede56e commit a0362e4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src-tauri/src/prefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,37 +218,37 @@ fn read_steam_registry() -> Result<PathBuf> {
}

fn default_steam_exe_path() -> PathBuf {
#[cfg(windows)]
#[cfg(target_os = "windows")]
{
match read_steam_registry() {
Ok(path) => path.join("Steam.exe"),
_ => r"C:\Program Files (x86)\Steam\Steam.exe".into(),
}
}

#[cfg(macos)]
#[cfg(target_os = "macos")]
{
"/Applications/Steam.app/Contents/MacOS/Steam".into()
}

#[cfg(linux)]
#[cfg(target_os = "linux")]
{
"/usr/bin/steam".into()
}
}

fn default_steam_library_dir(exe_path: Option<&Path>) -> Option<PathBuf> {
#[cfg(windows)]
#[cfg(target_os = "windows")]
{
exe_path.and_then(|exe| exe.parent().map(|parent| parent.to_path_buf()))
exe_path.and_then(|exe| exe.parent().map(|path| path.to_path_buf()))
}

#[cfg(macos)]
#[cfg(target_os = "macos")]
{
Some("~/Library/Application Support/Steam".into())
}

#[cfg(linux)]
#[cfg(target_os = "linux")]
{
dirs_next::data_dir().map(|data_dir| data_dir.join("Steam"))
}
Expand Down

0 comments on commit a0362e4

Please sign in to comment.