File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,24 @@ impl GlobalArgs {
5454 /// Initialize the global options.
5555 pub fn init ( & self ) -> eyre:: Result < ( ) > {
5656 // Set the global shell.
57- self . shell ( ) . set ( ) ;
57+ let shell = self . shell ( ) ;
58+ // Argument takes precedence over the env var global color choice.
59+ match shell. color_choice ( ) {
60+ ColorChoice :: Auto => { }
61+ ColorChoice :: Always => yansi:: enable ( ) ,
62+ ColorChoice :: Never => yansi:: disable ( ) ,
63+ }
64+ shell. set ( ) ;
5865
5966 // Initialize the thread pool only if `threads` was requested to avoid unnecessary overhead.
6067 if self . threads . is_some ( ) {
6168 self . force_init_thread_pool ( ) ?;
6269 }
6370
6471 // Display a warning message if the current version is not stable.
65- if std :: env :: var ( "FOUNDRY_DISABLE_NIGHTLY_WARNING" ) . is_err ( )
72+ if IS_NIGHTLY_VERSION
6673 && !self . json
67- && IS_NIGHTLY_VERSION
74+ && std :: env :: var_os ( "FOUNDRY_DISABLE_NIGHTLY_WARNING" ) . is_none ( )
6875 {
6976 let _ = sh_warn ! ( "{}" , NIGHTLY_VERSION_WARNING_MESSAGE ) ;
7077 }
You can’t perform that action at this time.
0 commit comments