Commit a95c1996 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Disable colored output when output is piped.

parent 0cefe88b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -143,8 +143,11 @@ module JsDuck
    CLEAR = "\e[0m"

    # Helper for doing colored output in UNIX terminal
    #
    # Only does color output when STDERR is attached to TTY
    # i.e. is not piped/redirected.
    def paint(color_name, msg)
      if OS.windows?
      if OS.windows? || !$stderr.tty?
        msg
      else
        COLORS[color_name] + msg + CLEAR