File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
crates/tauri-cli/src/mobile Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @tauri-apps/cli " : patch:bug
3+ " tauri-cli " : patch:bug
4+ ---
5+
6+ Fixes mobile project initialization when using ` pnpx ` or ` pnpm dlx ` .
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ pub fn exec(
7979 if r. is_match ( & bin_stem. to_string_lossy ( ) ) {
8080 if var_os ( "PNPM_PACKAGE_NAME" ) . is_some ( ) {
8181 return ( "pnpm" . into ( ) , build_args) ;
82+ } else if is_pnpm_dlx ( ) {
83+ return ( "pnpm" . into ( ) , vec ! [ "dlx" , "@tauri-apps/cli" ] ) ;
8284 } else if let Some ( npm_execpath) = var_os ( "npm_execpath" ) {
8385 let manager_stem = PathBuf :: from ( & npm_execpath)
8486 . file_stem ( )
@@ -368,3 +370,17 @@ fn unprefix_path(
368370 )
369371 . map_err ( Into :: into)
370372}
373+
374+ fn is_pnpm_dlx ( ) -> bool {
375+ var_os ( "NODE_PATH" )
376+ . map ( PathBuf :: from)
377+ . is_some_and ( |node_path| {
378+ let mut iter = node_path. components ( ) . peekable ( ) ;
379+ while let Some ( c) = iter. next ( ) {
380+ if c. as_os_str ( ) == "pnpm" && iter. peek ( ) . is_some_and ( |c| c. as_os_str ( ) == "dlx" ) {
381+ return true ;
382+ }
383+ }
384+ false
385+ } )
386+ }
You can’t perform that action at this time.
0 commit comments