mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-16 03:10:38 +03:00
fix(cli): pnpm detection on mobile init and xcode-script (#9553)
* fix(cli): pnpm detection on mobile init * small outputFiles fix * same check for xcode-script * Discard changes to tooling/cli/node/index.js * Discard changes to tooling/cli/node/index.d.ts --------- Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
parent
bd64982fe6
commit
4a33bc6a62
6
.changes/fix-pnpm-check.md
Normal file
6
.changes/fix-pnpm-check.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"tauri-cli": patch:bug
|
||||||
|
"@tauri-apps/cli": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes `pnpm` detection when initializing and running a mobile project.
|
@ -103,7 +103,9 @@ pub fn exec(
|
|||||||
if let Some(bin_stem) = bin_path.file_stem() {
|
if let Some(bin_stem) = bin_path.file_stem() {
|
||||||
let r = regex::Regex::new("(nodejs|node)\\-?([1-9]*)*$").unwrap();
|
let r = regex::Regex::new("(nodejs|node)\\-?([1-9]*)*$").unwrap();
|
||||||
if r.is_match(&bin_stem.to_string_lossy()) {
|
if r.is_match(&bin_stem.to_string_lossy()) {
|
||||||
if let Some(npm_execpath) = var_os("npm_execpath") {
|
if var_os("PNPM_PACKAGE_NAME").is_some() {
|
||||||
|
return ("pnpm".into(), build_args);
|
||||||
|
} else if let Some(npm_execpath) = var_os("npm_execpath") {
|
||||||
let manager_stem = PathBuf::from(&npm_execpath)
|
let manager_stem = PathBuf::from(&npm_execpath)
|
||||||
.file_stem()
|
.file_stem()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -61,7 +61,7 @@ pub fn command(options: Options) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// `xcode-script` is ran from the `gen/apple` folder when not using NPM.
|
// `xcode-script` is ran from the `gen/apple` folder when not using NPM.
|
||||||
if var_os("npm_lifecycle_event").is_none() {
|
if var_os("npm_lifecycle_event").is_none() && var_os("PNPM_PACKAGE_NAME").is_none() {
|
||||||
set_current_dir(current_dir()?.parent().unwrap().parent().unwrap()).unwrap();
|
set_current_dir(current_dir()?.parent().unwrap().parent().unwrap()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,12 +261,15 @@ fn read_options(identifier: &str) -> CliOptions {
|
|||||||
let runtime = tokio::runtime::Runtime::new().unwrap();
|
let runtime = tokio::runtime::Runtime::new().unwrap();
|
||||||
let options = runtime
|
let options = runtime
|
||||||
.block_on(async move {
|
.block_on(async move {
|
||||||
|
let addr_path = temp_dir().join(format!("{identifier}-server-addr"));
|
||||||
let (tx, rx) = WsTransportClientBuilder::default()
|
let (tx, rx) = WsTransportClientBuilder::default()
|
||||||
.build(
|
.build(
|
||||||
format!(
|
format!(
|
||||||
"ws://{}",
|
"ws://{}",
|
||||||
read_to_string(temp_dir().join(format!("{identifier}-server-addr")))
|
read_to_string(&addr_path).unwrap_or_else(|e| panic!(
|
||||||
.expect("missing addr file")
|
"failed to read missing addr file {}: {e}",
|
||||||
|
addr_path.display()
|
||||||
|
))
|
||||||
)
|
)
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
|
@ -127,8 +127,9 @@ targets:
|
|||||||
name: Build Rust Code
|
name: Build Rust Code
|
||||||
basedOnDependencyAnalysis: false
|
basedOnDependencyAnalysis: false
|
||||||
outputFiles:
|
outputFiles:
|
||||||
- $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib-name}}.a
|
- $(SRCROOT)/Externals/x86_64/${CONFIGURATION}/lib{{app.lib-name}}.a
|
||||||
- $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/lib{{app.lib-name}}.a
|
- $(SRCROOT)/Externals/arm64/${CONFIGURATION}/lib{{app.lib-name}}.a
|
||||||
|
- $(SRCROOT)/Externals/arm64-sim/${CONFIGURATION}/lib{{app.lib-name}}.a
|
||||||
{{~#if ios-post-compile-scripts}}
|
{{~#if ios-post-compile-scripts}}
|
||||||
postCompileScripts:
|
postCompileScripts:
|
||||||
{{~#each ios-post-compile-scripts}}{{#if this.path}}
|
{{~#each ios-post-compile-scripts}}{{#if this.path}}
|
||||||
|
Loading…
Reference in New Issue
Block a user