1
1
use crate :: app:: { Cli , Commands } ;
2
2
use crate :: app_error:: AppError ;
3
+ use crate :: commands:: docker:: DockerCommands ;
3
4
use crate :: components:: * ;
4
5
use crate :: systems:: * ;
5
6
use async_trait:: async_trait;
@@ -201,17 +202,22 @@ impl CliSession {
201
202
self . workspace_config . telemetry
202
203
}
203
204
204
- pub fn requires_workspace_setup ( & self ) -> bool {
205
+ pub fn requires_workspace_configured ( & self ) -> bool {
205
206
!matches ! (
206
207
self . cli. command,
207
- Commands :: Completions ( _) | Commands :: Init ( _) | Commands :: Setup
208
+ Commands :: Completions ( _) | Commands :: Init ( _)
208
209
)
209
210
}
210
211
211
212
pub fn requires_toolchain_installed ( & self ) -> bool {
212
213
matches ! (
213
214
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
215
221
)
216
222
}
217
223
@@ -238,7 +244,7 @@ impl AppSession for CliSession {
238
244
239
245
self . working_dir = env:: current_dir ( ) . map_err ( |_| AppError :: MissingWorkingDir ) ?;
240
246
241
- self . workspace_root = if self . requires_workspace_setup ( ) {
247
+ self . workspace_root = if self . requires_workspace_configured ( ) {
242
248
startup:: find_workspace_root ( & self . working_dir ) ?
243
249
} else {
244
250
self . working_dir . clone ( )
@@ -253,7 +259,7 @@ impl AppSession for CliSession {
253
259
254
260
// Load configs
255
261
256
- if self . requires_workspace_setup ( ) {
262
+ if self . requires_workspace_configured ( ) {
257
263
let ( workspace_config, tasks_config, toolchain_config) = try_join ! (
258
264
startup:: load_workspace_config( self . config_loader. clone( ) , & self . workspace_root) ,
259
265
startup:: load_tasks_configs( self . config_loader. clone( ) , & self . workspace_root) ,
@@ -289,7 +295,7 @@ impl AppSession for CliSession {
289
295
analyze:: validate_version_constraint ( constraint, & self . cli_version ) ?;
290
296
}
291
297
292
- if self . requires_workspace_setup ( ) {
298
+ if self . requires_workspace_configured ( ) {
293
299
let cache_engine = self . get_cache_engine ( ) ?;
294
300
295
301
analyze:: install_proto (
0 commit comments