From a5d894f53d529717e8ce443a5959df913d0fca28 Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Wed, 17 Apr 2024 20:12:14 +0400 Subject: [PATCH] Fix `simulator-utils` bug: can't run pdx on macOs by relative path --- Cargo.lock | 4 ++-- support/sim-ctrl/Cargo.toml | 2 +- support/sim-ctrl/src/run.rs | 2 ++ support/tool/Cargo.toml | 2 +- support/tool/src/cli.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1dbaac25..a3ed1c93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3922,7 +3922,7 @@ dependencies = [ [[package]] name = "playdate-simulator-utils" -version = "0.1.4" +version = "0.1.5" dependencies = [ "async-std", "log", @@ -3970,7 +3970,7 @@ dependencies = [ [[package]] name = "playdate-tool" -version = "0.3.1" +version = "0.3.2" dependencies = [ "clap", "console-subscriber", diff --git a/support/sim-ctrl/Cargo.toml b/support/sim-ctrl/Cargo.toml index 3fec5466..585ed7fb 100644 --- a/support/sim-ctrl/Cargo.toml +++ b/support/sim-ctrl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-simulator-utils" -version = "0.1.4" +version = "0.1.5" readme = "README.md" description = "Cross-platform utils to deal with Playdate Simulator." keywords = ["playdate", "sdk", "utils"] diff --git a/support/sim-ctrl/src/run.rs b/support/sim-ctrl/src/run.rs index 6747fc20..afc5a696 100644 --- a/support/sim-ctrl/src/run.rs +++ b/support/sim-ctrl/src/run.rs @@ -13,6 +13,7 @@ pub async fn run(pdx: &Path, sdk: Option<&Path>) -> Result<(), Error> { #[allow(unused_mut)] let mut cmd = command(pdx, sdk)?; + #[cfg(any(feature = "tokio", feature = "async-std"))] let mut cmd = Command::from(cmd); @@ -29,6 +30,7 @@ pub async fn run(pdx: &Path, sdk: Option<&Path>) -> Result<(), Error> { #[cfg_attr(feature = "tracing", tracing::instrument)] pub fn command(pdx: &Path, sdk: Option<&Path>) -> Result { + let pdx = pdx.canonicalize()?; let sdk = sdk.map_or_else(Sdk::try_new, Sdk::try_new_exact)?; let (pwd, sim) = if cfg!(target_os = "macos") { diff --git a/support/tool/Cargo.toml b/support/tool/Cargo.toml index 155f878b..1f109b91 100644 --- a/support/tool/Cargo.toml +++ b/support/tool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-tool" -version = "0.3.1" +version = "0.3.2" readme = "README.md" description = "Tool for interaction with Playdate device and sim." keywords = ["playdate", "usb", "utility"] diff --git a/support/tool/src/cli.rs b/support/tool/src/cli.rs index d6a193ce..b595f36c 100644 --- a/support/tool/src/cli.rs +++ b/support/tool/src/cli.rs @@ -141,7 +141,7 @@ pub struct Install { pub pdx: PathBuf, /// Allow to overwrite existing files. - #[arg(long, default_value_t = false)] + #[arg(long, short, default_value_t = false)] pub force: bool, #[command(flatten)]