1
0
Fork 0

added conditional compilation

This commit is contained in:
Kim, Jimin 2022-02-08 19:27:44 +09:00
parent e6a963289d
commit 155f6b9805
2 changed files with 10 additions and 21 deletions

View file

@ -1,6 +1,7 @@
use super::InstallErr;
use std::fs;
use std::os::unix::prelude::PermissionsExt;
use std::path::Path;
@ -8,23 +9,8 @@ pub async fn unix_launch_option_setup(
window: &tauri::Window,
game_path: &str,
) -> Result<(), InstallErr> {
//
// skip if the OS is not linux or macOS
//
match std::env::consts::OS {
"linux" | "macos" => {
println!();
println!("Setting up steam launch option");
}
_ => {
println!();
println!("Skipping unix launch option setup");
return Ok(());
}
};
println!();
println!("Setting up steam launch option");
//
// make run_bepinex.sh executable

View file

@ -5,6 +5,7 @@ mod types;
mod clean;
mod install_bepinex;
mod install_mod;
#[cfg(not(target_os = "windows"))]
mod launch_options;
use types::InstallErr;
@ -83,12 +84,14 @@ pub async fn install(window: tauri::Window, game_path: String) -> Result<(), Ins
}
//
// Set steam launch option if OS is linux or macOS
// Set steam launch option if OS is not windows
//
match launch_options::unix_launch_option_setup(&window, game_path).await {
Ok(_) => {}
Err(err) => return Err(err),
if cfg!(not(target_os = "windows")) {
match launch_options::unix_launch_option_setup(&window, game_path).await {
Ok(_) => {}
Err(err) => return Err(err),
}
}
//