This repository was archived by the owner on Feb 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,8 @@ def guard
159159 # @param msg [String] the message to print
160160 # @return [void]
161161 def info ( msg )
162- self . class . stderr . puts "#{ GREEN [ "Info" ] } : #{ msg } "
162+ info = ENV [ "NO_COLOR" ] ? "Info" : GREEN [ "Info" ]
163+ self . class . stderr . puts "#{ info } : #{ msg } "
163164 end
164165
165166 # Print an information message, but only if verbose output has been enabled.
@@ -184,25 +185,26 @@ def bye(msg)
184185 # @return [void]
185186 def warn ( msg )
186187 return if @opts . no_warn?
187- self . class . stderr . puts "#{ YELLOW [ "Warning" ] } : #{ msg } "
188+ warning = ENV [ "NO_COLOR" ] ? "Warning" : YELLOW [ "Warning" ]
189+ self . class . stderr . puts "#{ warning } : #{ msg } "
188190 end
189191
190192 # Print an error message and terminate.
191193 # @param msg [String] the message to print
192194 # @return [void]
193195 # @note This method does not return!
194196 def die ( msg )
195- pretty = " #{ RED [ "Fatal" ] } : #{ msg } "
196- abort pretty
197+ fatal = ENV [ "NO_COLOR" ] ? "Fatal" : RED [ "Fatal" ]
198+ abort " #{ fatal } : #{ msg } "
197199 end
198200
199201 # Print an error message and terminate.
200202 # @param msg [String] the message to print
201203 # @return [void]
202204 # @note This method does not return!
203205 def self . die ( msg )
204- pretty = " #{ RED [ "Fatal" ] } : #{ msg } "
205- abort pretty
206+ fatal = ENV [ "NO_COLOR" ] ? "Fatal" : RED [ "Fatal" ]
207+ abort " #{ fatal } : #{ msg } "
206208 end
207209
208210 # Finds a reasonable default field separator by checking the environment first
You can’t perform that action at this time.
0 commit comments