File tree Expand file tree Collapse file tree 3 files changed +24
-9
lines changed
Expand file tree Collapse file tree 3 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' cli.rs ' : ' patch'
3+ ' cli.js ' : ' patch'
4+ ---
5+
6+ Fix android project build crashing when using ` pnpm ` caused by extra ` -- ` .
Original file line number Diff line number Diff line change 1- // Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2- // SPDX-License-Identifier: Apache-2.0
3- // SPDX-License-Identifier: MIT
4-
51const { existsSync, readFileSync } = require ( 'fs' )
62const { join } = require ( 'path' )
73
@@ -15,7 +11,8 @@ function isMusl() {
1511 // For Node 10
1612 if ( ! process . report || typeof process . report . getReport !== 'function' ) {
1713 try {
18- return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
14+ const lddPath = require ( 'child_process' ) . execSync ( 'which ldd' ) . toString ( ) . trim ( ) ;
15+ return readFileSync ( lddPath , 'utf8' ) . includes ( 'musl' )
1916 } catch ( e ) {
2017 return true
2118 }
@@ -105,6 +102,15 @@ switch (platform) {
105102 }
106103 break
107104 case 'darwin' :
105+ localFileExisted = existsSync ( join ( __dirname , 'cli.darwin-universal.node' ) )
106+ try {
107+ if ( localFileExisted ) {
108+ nativeBinding = require ( './cli.darwin-universal.node' )
109+ } else {
110+ nativeBinding = require ( '@tauri-apps/cli-darwin-universal' )
111+ }
112+ break
113+ } catch { }
108114 switch ( arch ) {
109115 case 'x64' :
110116 localFileExisted = existsSync ( join ( __dirname , 'cli.darwin-x64.node' ) )
Original file line number Diff line number Diff line change @@ -124,19 +124,22 @@ pub fn exec(
124124 if r. is_match ( & bin_stem) {
125125 if let Some ( npm_execpath) = var_os ( "npm_execpath" ) . map ( PathBuf :: from) {
126126 let manager_stem = npm_execpath. file_stem ( ) . unwrap ( ) . to_os_string ( ) ;
127- let manager = if manager_stem == "npm-cli" {
127+ binary = if manager_stem == "npm-cli" {
128128 "npm" . into ( )
129129 } else {
130130 manager_stem
131131 } ;
132- binary = manager;
133132 if !build_args. is_empty ( ) {
134133 // remove script path, we'll use `npm_lifecycle_event` instead
135134 build_args. remove ( 0 ) ;
136135 }
137- build_args. insert ( 0 , "--" . into ( ) ) ;
136+ if binary == "npm" {
137+ build_args. insert ( 0 , "--" . into ( ) ) ;
138+ }
138139 build_args. insert ( 0 , var ( "npm_lifecycle_event" ) . unwrap ( ) ) ;
139- build_args. insert ( 0 , "run" . into ( ) ) ;
140+ if binary == "npm" {
141+ build_args. insert ( 0 , "run" . into ( ) ) ;
142+ }
140143 }
141144 }
142145 map. insert ( "tauri-binary" , binary. to_string_lossy ( ) ) ;
You can’t perform that action at this time.
0 commit comments