diff --git a/src/main.rs b/src/main.rs index f491598..1a24be6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use std::{ fs::{self}, io::Write, path::{Path, PathBuf}, - process::{Command, Stdio}, + process::{Command, ExitStatus, Stdio}, thread, time, }; use structopt::StructOpt; @@ -581,7 +581,12 @@ impl Build { let status = { let mut cmd = Command::new("PlaydateSimulator"); cmd.arg(&pdx_path); - cmd.status()? + cmd.status().or_else(|_| -> Result { + info!("falling back on SDK path"); + cmd = Command::new(playdate_sdk_path()?.join("bin").join("PlaydateSimulator")); + cmd.arg(&pdx_path); + Ok(cmd.status()?) + })? }; if !status.success() {