File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,18 @@ impl Process {
205205 #[ cfg( feature = "test" ) ]
206206 Process :: TestProcess ( _) => return ProgressDrawTarget :: hidden ( ) ,
207207 }
208- let t = self . stdout ( ) ;
209- match self . var ( "RUSTUP_TERM_PROGRESS_WHEN" ) {
210- Ok ( s) if s. eq_ignore_ascii_case ( "always" ) => ProgressDrawTarget :: term_like ( Box :: new ( t) ) ,
211- Ok ( s) if s. eq_ignore_ascii_case ( "never" ) => ProgressDrawTarget :: hidden ( ) ,
212- _ if t. is_a_tty ( ) => ProgressDrawTarget :: term_like ( Box :: new ( t) ) ,
213- _ => ProgressDrawTarget :: hidden ( ) ,
208+
209+ let term = self . stdout ( ) ;
210+ let term = match self . var ( "RUSTUP_TERM_PROGRESS_WHEN" ) {
211+ Ok ( s) if s. eq_ignore_ascii_case ( "always" ) => Some ( term) ,
212+ Ok ( s) if s. eq_ignore_ascii_case ( "never" ) => None ,
213+ _ if term. is_a_tty ( ) => Some ( term) ,
214+ _ => None ,
215+ } ;
216+
217+ match term {
218+ Some ( t) => ProgressDrawTarget :: term_like ( Box :: new ( t) ) ,
219+ None => ProgressDrawTarget :: hidden ( ) ,
214220 }
215221 }
216222
You can’t perform that action at this time.
0 commit comments