Skip to content

Commit 38a75a9

Browse files
authored
launch: support macos (#1201)
1 parent 219f785 commit 38a75a9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

bin/src/commands/launch/launcher.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ impl<'a> Launcher<'a> {
303303
if instances.len() == 1 {
304304
let mut cmd = if cfg!(target_os = "windows") {
305305
super::platforms::windows(&self.arma3, &self.executable, &instances[0])
306+
} else if cfg!(target_os = "macos") {
307+
super::platforms::macos(&instances[0])
306308
} else {
307309
super::platforms::linux(&instances[0])
308310
}?;
@@ -319,6 +321,8 @@ impl<'a> Launcher<'a> {
319321
children.push(
320322
if cfg!(target_os = "windows") {
321323
super::platforms::windows(&self.arma3, &self.executable, &instance)?
324+
} else if cfg!(target_os = "macos") {
325+
super::platforms::macos(&instance)?
322326
} else {
323327
super::platforms::linux(&instance)?
324328
}

bin/src/commands/launch/platforms.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,16 @@ pub fn linux(args: &[String]) -> Result<Command, Error> {
9090
};
9191
Ok(cmd)
9292
}
93+
94+
#[allow(clippy::unnecessary_wraps)]
95+
pub fn macos(args: &[String]) -> Result<Command, Error> {
96+
info!("Launching with:\n {}", args.join("\n "));
97+
let mut cmd = std::process::Command::new("/Applications/Steam.app/Contents/MacOS/steam_osx");
98+
cmd.arg("-applaunch")
99+
.arg("107410")
100+
.arg("-nolauncher")
101+
.args(args)
102+
.stdout(std::process::Stdio::null())
103+
.stderr(std::process::Stdio::null());
104+
Ok(cmd)
105+
}

0 commit comments

Comments
 (0)