File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ releases :
2+ " @moonrepo/cli " : patch
3+ " @moonrepo/core-linux-arm64-gnu " : patch
4+ " @moonrepo/core-linux-arm64-musl " : patch
5+ " @moonrepo/core-linux-x64-gnu " : patch
6+ " @moonrepo/core-linux-x64-musl " : patch
7+ " @moonrepo/core-macos-arm64 " : patch
8+ " @moonrepo/core-macos-x64 " : patch
9+ " @moonrepo/core-windows-x64-msvc " : patch
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ #### 🐞 Fixes
6+
7+ - Fixed an issue where ` NO_COLOR ` or ` FORCE_COLOR ` would be overwritten for task child processes.
8+
39## 1.32.1
410
511#### 🚀 Updates
Original file line number Diff line number Diff line change @@ -138,12 +138,20 @@ impl Command {
138138 }
139139
140140 pub fn inherit_colors ( & mut self ) -> & mut Self {
141- let level = color:: supports_color ( ) . to_string ( ) ;
142-
141+ // Don't show colors in our own tests, as it disrupts snapshots
143142 if !is_test_env ( ) {
144- self . env_remove ( "NO_COLOR" ) ;
145- self . env ( "FORCE_COLOR" , & level) ;
146- self . env ( "CLICOLOR_FORCE" , & level) ;
143+ let no_color = OsString :: from ( "NO_COLOR" ) ;
144+ let force_color = OsString :: from ( "FORCE_COLOR" ) ;
145+
146+ // Only inherit colors if the current command hasn't
147+ // explicitly configured these variables
148+ if !self . env . contains_key ( & no_color) && !self . env . contains_key ( & force_color) {
149+ let level = color:: supports_color ( ) . to_string ( ) ;
150+
151+ self . env_remove ( no_color) ;
152+ self . env ( force_color, & level) ;
153+ self . env ( "CLICOLOR_FORCE" , & level) ;
154+ }
147155 }
148156
149157 // Force a terminal width so that we have consistent sizing
Original file line number Diff line number Diff line change @@ -87,10 +87,10 @@ $ MOON_CONCURRENCY=1 moon run app:build
8787At minimum, most debugging can be done by passing [ ` --log trace ` ] ( #logging ) on the command line and
8888sifting through the logs. We also provide the following environment variables to toggle output.
8989
90- - ` MOON_DEBUG_PROCESS_ENV ` - By default moon hides the environment variables (except for ` MOON ` or
91- ` PROTO ` ) passed to processes to avoid leaking sensitive information. However, knowing what
92- environment variables are passed around is helpful in debugging. Declare this variable to reveal
93- the entire environment.
90+ - ` MOON_DEBUG_PROCESS_ENV ` - By default moon hides the environment variables (except for ` MOON_ ` )
91+ passed to processes to avoid leaking sensitive information. However, knowing what environment
92+ variables are passed around is helpful in debugging. Declare this variable to reveal the entire
93+ environment.
9494- ` MOON_DEBUG_PROCESS_INPUT ` - By default moon truncates the stdin passed to processes to avoid
9595 thrashing the console with a large input string. However, knowing what input is passed around is
9696 helpful in debugging. Declare this variable to reveal the entire input.
You can’t perform that action at this time.
0 commit comments