11use crate :: app:: { Cli , Commands } ;
22use crate :: app_error:: AppError ;
3+ use crate :: commands:: docker:: DockerCommands ;
34use crate :: components:: * ;
45use crate :: systems:: * ;
56use async_trait:: async_trait;
@@ -201,17 +202,22 @@ impl CliSession {
201202 self . workspace_config . telemetry
202203 }
203204
204- pub fn requires_workspace_setup ( & self ) -> bool {
205+ pub fn requires_workspace_configured ( & self ) -> bool {
205206 !matches ! (
206207 self . cli. command,
207- Commands :: Completions ( _) | Commands :: Init ( _) | Commands :: Setup
208+ Commands :: Completions ( _) | Commands :: Init ( _)
208209 )
209210 }
210211
211212 pub fn requires_toolchain_installed ( & self ) -> bool {
212213 matches ! (
213214 self . cli. command,
214- Commands :: Bin ( _) | Commands :: Docker { .. } | Commands :: Node { .. } | Commands :: Teardown
215+ Commands :: Bin ( _)
216+ | Commands :: Docker {
217+ command: DockerCommands :: Prune { }
218+ }
219+ | Commands :: Node { .. }
220+ | Commands :: Teardown
215221 )
216222 }
217223
@@ -238,7 +244,7 @@ impl AppSession for CliSession {
238244
239245 self . working_dir = env:: current_dir ( ) . map_err ( |_| AppError :: MissingWorkingDir ) ?;
240246
241- self . workspace_root = if self . requires_workspace_setup ( ) {
247+ self . workspace_root = if self . requires_workspace_configured ( ) {
242248 startup:: find_workspace_root ( & self . working_dir ) ?
243249 } else {
244250 self . working_dir . clone ( )
@@ -253,7 +259,7 @@ impl AppSession for CliSession {
253259
254260 // Load configs
255261
256- if self . requires_workspace_setup ( ) {
262+ if self . requires_workspace_configured ( ) {
257263 let ( workspace_config, tasks_config, toolchain_config) = try_join ! (
258264 startup:: load_workspace_config( self . config_loader. clone( ) , & self . workspace_root) ,
259265 startup:: load_tasks_configs( self . config_loader. clone( ) , & self . workspace_root) ,
@@ -289,7 +295,7 @@ impl AppSession for CliSession {
289295 analyze:: validate_version_constraint ( constraint, & self . cli_version ) ?;
290296 }
291297
292- if self . requires_workspace_setup ( ) {
298+ if self . requires_workspace_configured ( ) {
293299 let cache_engine = self . get_cache_engine ( ) ?;
294300
295301 analyze:: install_proto (
0 commit comments