@@ -314,7 +314,7 @@ struct CliFactoryServices {
314314 resolver_factory : Deferred < Arc < CliResolverFactory > > ,
315315 root_cert_store_provider : Deferred < Arc < dyn RootCertStoreProvider > > ,
316316 root_permissions_container : Deferred < PermissionsContainer > ,
317- text_only_progress_bar : Deferred < Option < ProgressBar > > ,
317+ text_only_progress_bar : Deferred < ProgressBar > ,
318318 type_checker : Deferred < Arc < TypeChecker > > ,
319319 workspace_factory : Deferred < Arc < CliWorkspaceFactory > > ,
320320 install_reporter :
@@ -441,23 +441,11 @@ impl CliFactory {
441441 } )
442442 }
443443
444- pub fn text_only_progress_bar (
445- & self ,
446- ) -> Result < Option < & ProgressBar > , AnyError > {
444+ pub fn text_only_progress_bar ( & self ) -> & ProgressBar {
447445 self
448446 . services
449447 . text_only_progress_bar
450- . get_or_try_init ( || {
451- if matches ! (
452- self . cli_options( ) ?. sub_command( ) ,
453- DenoSubcommand :: Install ( _)
454- ) {
455- Ok ( None )
456- } else {
457- Ok ( Some ( ProgressBar :: new ( ProgressBarStyle :: TextOnly ) ) )
458- }
459- } )
460- . map ( |opt| opt. as_ref ( ) )
448+ . get_or_init ( || ProgressBar :: new ( ProgressBarStyle :: TextOnly ) )
461449 }
462450
463451 pub fn global_http_cache ( & self ) -> Result < & Arc < GlobalHttpCache > , AnyError > {
@@ -504,15 +492,8 @@ impl CliFactory {
504492 CreateCliFileFetcherOptions {
505493 allow_remote : !cli_options. no_remote ( ) ,
506494 cache_setting : cli_options. cache_setting ( ) ,
507- download_log_level : if matches ! (
508- cli_options. sub_command( ) ,
509- DenoSubcommand :: Install ( _)
510- ) {
511- log:: Level :: Trace
512- } else {
513- log:: Level :: Info
514- } ,
515- progress_bar : self . text_only_progress_bar ( ) ?. cloned ( ) ,
495+ download_log_level : log:: Level :: Info ,
496+ progress_bar : Some ( self . text_only_progress_bar ( ) . clone ( ) ) ,
516497 } ,
517498 ) ) )
518499 } )
@@ -572,7 +553,7 @@ impl CliFactory {
572553 resolver_factory. clone ( ) ,
573554 Arc :: new ( CliNpmCacheHttpClient :: new (
574555 self . http_client_provider ( ) . clone ( ) ,
575- self . text_only_progress_bar ( ) ? . cloned ( ) ,
556+ self . text_only_progress_bar ( ) . clone ( ) ,
576557 ) ) ,
577558 match resolver_factory. npm_resolver ( ) ?. as_managed ( ) {
578559 Some ( managed_npm_resolver) => Arc :: new (
@@ -581,7 +562,7 @@ impl CliFactory {
581562 as Arc < dyn LifecycleScriptsExecutor > ,
582563 None => Arc :: new ( NullLifecycleScriptsExecutor ) ,
583564 } ,
584- self . text_only_progress_bar ( ) ? . cloned ( ) ,
565+ self . text_only_progress_bar ( ) . clone ( ) ,
585566 self
586567 . install_reporter ( ) ?
587568 . cloned ( )
@@ -608,7 +589,7 @@ impl CliFactory {
608589 . services
609590 . install_reporter
610591 . get_or_try_init ( || match self . cli_options ( ) ?. sub_command ( ) {
611- DenoSubcommand :: Install ( _ ) => Ok ( Some ( Arc :: new (
592+ DenoSubcommand :: Install ( InstallFlags :: Local ( _ ) ) => Ok ( Some ( Arc :: new (
612593 crate :: tools:: installer:: InstallReporter :: new ( ) ,
613594 ) ) ) ,
614595 _ => Ok ( None ) ,
@@ -787,7 +768,7 @@ impl CliFactory {
787768 self . npm_installer_if_managed ( ) . await ?. cloned ( ) ,
788769 self . npm_resolver ( ) . await ?. clone ( ) ,
789770 self . resolver_factory ( ) ?. parsed_source_cache ( ) . clone ( ) ,
790- self . text_only_progress_bar ( ) ? . cloned ( ) ,
771+ self . text_only_progress_bar ( ) . clone ( ) ,
791772 self . resolver ( ) . await ?. clone ( ) ,
792773 self . root_permissions_container ( ) ?. clone ( ) ,
793774 self . sys ( ) ,
@@ -866,7 +847,7 @@ impl CliFactory {
866847 cli_options. clone ( ) ,
867848 self . maybe_lockfile ( ) . await ?. cloned ( ) ,
868849 self . module_graph_builder ( ) . await ?. clone ( ) ,
869- self . text_only_progress_bar ( ) ? . cloned ( ) ,
850+ self . text_only_progress_bar ( ) . clone ( ) ,
870851 self . type_checker ( ) . await ?. clone ( ) ,
871852 ) ) )
872853 }
0 commit comments