@@ -14,7 +14,6 @@ use crate::package_manager::{
1414pub struct UpdateCommandOptions < ' a > {
1515 pub packages : & ' a [ String ] ,
1616 pub latest : bool ,
17- pub global : bool ,
1817 pub recursive : bool ,
1918 pub filters : Option < & ' a [ String ] > ,
2019 pub workspace_root : bool ,
@@ -48,19 +47,6 @@ impl PackageManager {
4847 let envs = HashMap :: from ( [ ( "PATH" . to_string ( ) , format_path_env ( self . get_bin_prefix ( ) ) ) ] ) ;
4948 let mut args: Vec < String > = Vec :: new ( ) ;
5049
51- // global packages should use npm cli only
52- if options. global {
53- bin_name = "npm" . into ( ) ;
54- args. push ( "update" . into ( ) ) ;
55- args. push ( "--global" . into ( ) ) ;
56- if let Some ( pass_through_args) = options. pass_through_args {
57- args. extend_from_slice ( pass_through_args) ;
58- }
59- args. extend_from_slice ( options. packages ) ;
60-
61- return ResolveCommandResult { bin_path : bin_name, args, envs } ;
62- }
63-
6450 match self . client {
6551 PackageManagerType :: Pnpm => {
6652 bin_name = "pnpm" . into ( ) ;
@@ -249,7 +235,6 @@ mod tests {
249235 let result = pm. resolve_update_command ( & UpdateCommandOptions {
250236 packages : & [ "react" . to_string ( ) ] ,
251237 latest : false ,
252- global : false ,
253238 recursive : false ,
254239 filters : None ,
255240 workspace_root : false ,
@@ -539,18 +524,6 @@ mod tests {
539524 assert_eq ! ( result. bin_path, "npm" ) ;
540525 }
541526
542- #[ test]
543- fn test_global_update ( ) {
544- let pm = create_mock_package_manager ( PackageManagerType :: Pnpm , "10.0.0" ) ;
545- let result = pm. resolve_update_command ( & UpdateCommandOptions {
546- packages : & [ "typescript" . to_string ( ) ] ,
547- global : true ,
548- ..Default :: default ( )
549- } ) ;
550- assert_eq ! ( result. args, vec![ "update" , "--global" , "typescript" ] ) ;
551- assert_eq ! ( result. bin_path, "npm" ) ;
552- }
553-
554527 #[ test]
555528 fn test_pnpm_update_multiple_packages ( ) {
556529 let pm = create_mock_package_manager ( PackageManagerType :: Pnpm , "10.0.0" ) ;
0 commit comments