Skip to content

Commit

Permalink
Merge pull request #45 from lyonbeckers/linux-simulator-path
Browse files Browse the repository at this point in the history
get the sdk path to find the executable on linux
  • Loading branch information
boozook authored Aug 6, 2023
2 parents 3472baf + 22db311 commit 6d046ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ExitStatus, Error> {
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() {
Expand Down

0 comments on commit 6d046ce

Please sign in to comment.