@@ -103,14 +103,14 @@ impl PackageManager {
103103
104104 if let PackageManager :: Yarn = self {
105105 command. env ( "npm_config_global_folder" , self . source_root ( package_root) ) ;
106- } else
107- // FIXME: Find out if there is a perfect way to intercept pnpm global
108- // installs by using environment variables or whatever.
109- // Using `--global-dir` and `--global-bin-dir` flags here is not enough,
110- // because pnpm generates _absolute path_ based symlinks, and this makes
111- // impossible to simply move installed packages from the staging directory
112- // to the final `image/packages/` destination.
113- if let PackageManager :: Pnpm = self {
106+ } else if let PackageManager :: Pnpm = self {
107+ // FIXME: Find out if there is a perfect way to intercept pnpm global
108+ // installs by using environment variables or whatever.
109+ // Using `--global-dir` and `--global-bin-dir` flags here is not enough,
110+ // because pnpm generates _absolute path_ based symlinks, and this makes
111+ // impossible to simply move installed packages from the staging directory
112+ // to the final `image/packages/` destination.
113+
114114 // Specify the staging directory to store global package,
115115 // see: https://pnpm.io/npmrc#global-dir
116116 command. arg ( "--global-dir" ) . arg ( & package_root) ;
@@ -125,8 +125,7 @@ impl PackageManager {
125125 // pass the check.
126126 // See: https://github.com/volta-cli/rfcs/pull/46#discussion_r861943740
127127 let mut new_path = global_bin_dir;
128- let mut command_envs = command. get_envs ( ) ;
129- while let Some ( ( name, value) ) = command_envs. next ( ) {
128+ for ( name, value) in command. get_envs ( ) {
130129 if name == "PATH" {
131130 if let Some ( old_path) = value {
132131 #[ cfg( unix) ]
0 commit comments