Skip to content

Commit 712f104

Browse files
authored
fix(cli): ios dev and ios build support for bun (#10569)
1 parent 41c7a66 commit 712f104

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changes/fix-ios-bun-support.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Fixes running `ios dev` and `ios build` using `bun`.

tooling/cli/src/mobile/ios/xcode_script.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use clap::Parser;
1414

1515
use std::{
1616
collections::HashMap,
17-
env::{current_dir, set_current_dir, var_os},
17+
env::{current_dir, set_current_dir, var, var_os},
1818
ffi::OsStr,
1919
path::{Path, PathBuf},
2020
process::Command,
@@ -62,7 +62,10 @@ pub fn command(options: Options) -> Result<()> {
6262
}
6363

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

0 commit comments

Comments
 (0)