Skip to content

Commit

Permalink
fix(cli): ios dev and ios build support for bun (#10569)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Aug 13, 2024
1 parent 41c7a66 commit 712f104
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-ios-bun-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-cli": patch:bug
"@tauri-apps/cli": patch:bug
---

Fixes running `ios dev` and `ios build` using `bun`.
7 changes: 5 additions & 2 deletions tooling/cli/src/mobile/ios/xcode_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use clap::Parser;

use std::{
collections::HashMap,
env::{current_dir, set_current_dir, var_os},
env::{current_dir, set_current_dir, var, var_os},
ffi::OsStr,
path::{Path, PathBuf},
process::Command,
Expand Down Expand Up @@ -62,7 +62,10 @@ pub fn command(options: Options) -> Result<()> {
}

// `xcode-script` is ran from the `gen/apple` folder when not using NPM.
if var_os("npm_lifecycle_event").is_none() && var_os("PNPM_PACKAGE_NAME").is_none() {
// so we must change working directory to the src-tauri folder to resolve the tauri dir
if (var_os("npm_lifecycle_event").is_none() && var_os("PNPM_PACKAGE_NAME").is_none())
|| var("npm_config_user_agent").map_or(false, |agent| agent.starts_with("bun"))
{
set_current_dir(current_dir()?.parent().unwrap().parent().unwrap()).unwrap();
}

Expand Down

0 comments on commit 712f104

Please sign in to comment.