From c892e27bc21cdd32449195b643bea398eb339568 Mon Sep 17 00:00:00 2001
From: Jeff Dickey <216188+jdx@users.noreply.github.com>
Date: Sun, 13 Oct 2024 21:17:51 -0500
Subject: [PATCH] feat: enable colors for CI services that support it
---
src/config/settings.rs | 3 +++
src/env.rs | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/src/config/settings.rs b/src/config/settings.rs
index 493d48f98..017c5d35b 100644
--- a/src/config/settings.rs
+++ b/src/config/settings.rs
@@ -138,6 +138,9 @@ impl Settings {
if !settings.color {
console::set_colors_enabled(false);
console::set_colors_enabled_stderr(false);
+ } else if *env::COLOR_NONTTY_OK {
+ console::set_colors_enabled(true);
+ console::set_colors_enabled_stderr(true);
}
if settings.ci {
settings.yes = true;
diff --git a/src/env.rs b/src/env.rs
index f4aeb0db2..0cdbb9e22 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -164,6 +164,24 @@ pub static GITHUB_TOKEN: Lazy