File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async fn main() -> Result<(), Error> {
88 let package_manager = PackageManager :: builder ( & current_dir) . build ( ) . await ?;
99 println ! ( "Package manager: {package_manager:#?} for {current_dir:?}" ) ;
1010
11- let resolve_command = package_manager. resolve_command ( ) ;
11+ let resolve_command = package_manager. resolve_install_command ( & vec ! [ ] ) ;
1212 println ! ( "Resolve command: {resolve_command:#?}" ) ;
1313
1414 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use std::{
33 env, fmt,
44 fs:: { self , File } ,
55 io:: { BufReader , Seek , SeekFrom } ,
6+ iter,
67 path:: Path ,
78} ;
89
@@ -50,6 +51,7 @@ impl fmt::Display for PackageManagerType {
5051#[ derive( Debug ) ]
5152pub struct ResolveCommandResult {
5253 pub bin_path : String ,
54+ pub args : Vec < String > ,
5355 pub envs : HashMap < String , String > ,
5456}
5557
@@ -147,9 +149,13 @@ impl PackageManager {
147149 }
148150
149151 #[ must_use]
150- pub fn resolve_command ( & self ) -> ResolveCommandResult {
152+ pub fn resolve_install_command ( & self , args : & Vec < String > ) -> ResolveCommandResult {
151153 ResolveCommandResult {
152154 bin_path : self . bin_name . to_string ( ) ,
155+ args : iter:: once ( "install" )
156+ . chain ( args. iter ( ) . map ( String :: as_str) )
157+ . map ( String :: from)
158+ . collect ( ) ,
153159 envs : HashMap :: from ( [ ( "PATH" . to_string ( ) , format_path_env ( self . get_bin_prefix ( ) ) ) ] ) ,
154160 }
155161 }
Original file line number Diff line number Diff line change 11use std:: {
22 env,
33 io:: { self , IsTerminal , Write } ,
4- iter,
54} ;
65
76use crossterm:: {
@@ -59,11 +58,11 @@ impl InstallCommand {
5958 Err ( e) => return Err ( e) ,
6059 } ;
6160 let workspace = Workspace :: partial_load ( self . workspace_root ) ?;
62- let resolve_command = package_manager. resolve_command ( ) ;
61+ let resolve_command = package_manager. resolve_install_command ( args ) ;
6362 let resolved_task = ResolvedTask :: resolve_from_builtin_with_command_result (
6463 & workspace,
6564 "install" ,
66- iter :: once ( "install" ) . chain ( args. iter ( ) . map ( String :: as_str ) ) ,
65+ resolve_command . args . iter ( ) ,
6766 ResolveCommandResult { bin_path : resolve_command. bin_path , envs : resolve_command. envs } ,
6867 self . ignore_replay ,
6968 Some ( package_manager. get_fingerprint_ignores ( ) ) ,
You can’t perform that action at this time.
0 commit comments