File tree Expand file tree Collapse file tree 2 files changed +22
-18
lines changed
crates/tauri-cli/src/helpers Expand file tree Collapse file tree 2 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' tauri-cli ' : ' patch:bug'
3+ ---
4+
5+ For bun's lockfile, check both ` bun.lock ` and ` bun.lockb ` .
Original file line number Diff line number Diff line change @@ -67,24 +67,23 @@ impl PackageManager {
6767 for entry in entries. flatten ( ) {
6868 let path = entry. path ( ) ;
6969 let name = path. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
70- if name. as_ref ( ) == "package-lock.json" {
71- found. push ( PackageManager :: Npm ) ;
72- } else if name. as_ref ( ) == "pnpm-lock.yaml" {
73- found. push ( PackageManager :: Pnpm ) ;
74- } else if name. as_ref ( ) == "yarn.lock" {
75- let yarn = if manager_version ( "yarn" )
76- . map ( |v| v. chars ( ) . next ( ) . map ( |c| c > '1' ) . unwrap_or_default ( ) )
77- . unwrap_or ( false )
78- {
79- PackageManager :: YarnBerry
80- } else {
81- PackageManager :: Yarn
82- } ;
83- found. push ( yarn) ;
84- } else if name. as_ref ( ) == "bun.lockb" {
85- found. push ( PackageManager :: Bun ) ;
86- } else if name. as_ref ( ) == "deno.lock" {
87- found. push ( PackageManager :: Deno ) ;
70+ match name. as_ref ( ) {
71+ "package-lock.json" => found. push ( PackageManager :: Npm ) ,
72+ "pnpm-lock.yaml" => found. push ( PackageManager :: Pnpm ) ,
73+ "yarn.lock" => {
74+ let yarn = if manager_version ( "yarn" )
75+ . map ( |v| v. chars ( ) . next ( ) . map ( |c| c > '1' ) . unwrap_or_default ( ) )
76+ . unwrap_or ( false )
77+ {
78+ PackageManager :: YarnBerry
79+ } else {
80+ PackageManager :: Yarn
81+ } ;
82+ found. push ( yarn) ;
83+ }
84+ "bun.lock" | "bun.lockb" => found. push ( PackageManager :: Bun ) ,
85+ "deno.lock" => found. push ( PackageManager :: Deno ) ,
86+ _ => ( ) ,
8887 }
8988 }
9089 }
You can’t perform that action at this time.
0 commit comments