Skip to content

Instantly share code, notes, and snippets.

@EugenMayer
Created February 22, 2018 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EugenMayer/b97a008b6422102f6e1937368794c7a8 to your computer and use it in GitHub Desktop.
Save EugenMayer/b97a008b6422102f6e1937368794c7a8 to your computer and use it in GitHub Desktop.
Pathes Ruby thor to support the NO_COLOR env variable to stop using colors e.g. when you want to parse logs
class Thor
module Shell
class Color
def can_display_colors?
return false unless ENV['NO_COLOR'].nil?
stdout.tty?
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment