From 4a12f2980347c0b5effde7317c2924de6f4ff1a0 Mon Sep 17 00:00:00 2001 From: John Kelly Date: Thu, 2 Mar 2023 14:46:42 +0000 Subject: [PATCH 1/2] Allow force-enabling colors Useful for places such as GitHub actions where you want colour, but are not in a TTY --- lib/thor/shell/color.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thor/shell/color.rb b/lib/thor/shell/color.rb index aee95292..dd79cdee 100644 --- a/lib/thor/shell/color.rb +++ b/lib/thor/shell/color.rb @@ -97,7 +97,7 @@ def set_color(string, *colors) protected def can_display_colors? - are_colors_supported? && !are_colors_disabled? + ENV['FORCE_COLOR'].present? || (are_colors_supported? && !are_colors_disabled?) end def are_colors_supported? From 44ce47685b61538b086b1e8c37e17a5512bc5ce7 Mon Sep 17 00:00:00 2001 From: John Kelly Date: Tue, 25 Apr 2023 13:38:02 +0100 Subject: [PATCH 2/2] Update color.rb --- lib/thor/shell/color.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thor/shell/color.rb b/lib/thor/shell/color.rb index dd79cdee..0602deeb 100644 --- a/lib/thor/shell/color.rb +++ b/lib/thor/shell/color.rb @@ -97,7 +97,7 @@ def set_color(string, *colors) protected def can_display_colors? - ENV['FORCE_COLOR'].present? || (are_colors_supported? && !are_colors_disabled?) + ENV['FORCE_COLOR'] || (are_colors_supported? && !are_colors_disabled?) end def are_colors_supported?