From 58ab1e4a1dbe04ce23396495e54da5239399c195 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 15 May 2023 13:11:59 +0300 Subject: [PATCH 1/2] Do not disable colors on CI --- cli/cli.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 277cbb50..4bd97c00 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -39,7 +39,7 @@ import ( // Application info const ( APP = "bibop" - VER = "7.2.0" + VER = "7.2.1" DESC = "Utility for testing command-line tools" ) @@ -150,6 +150,12 @@ func preConfigureUI() { } } + if os.Getenv("CI") == "" { + fmtutil.SeparatorFullscreen = true + } else { + fmtc.DisableColors = false + } + if !fsutil.IsCharacterDevice("/dev/stdout") && os.Getenv("FAKETTY") == "" { fmtc.DisableColors = true rawOutput = true @@ -166,10 +172,6 @@ func configureUI() { fmtc.DisableColors = true } - if os.Getenv("CI") == "" { - fmtutil.SeparatorFullscreen = true - } - fmtutil.SeparatorSymbol = "–" switch { From 5a7f00a8c734f5ef7cd6b7ca951038e86b3d8505 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 15 May 2023 17:44:47 +0300 Subject: [PATCH 2/2] Do not disable colors on CI --- cli/cli.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index 4bd97c00..879b4ebe 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -156,7 +156,10 @@ func preConfigureUI() { fmtc.DisableColors = false } - if !fsutil.IsCharacterDevice("/dev/stdout") && os.Getenv("FAKETTY") == "" { + // Check for output redirect using pipes + if fsutil.IsCharacterDevice("/dev/stdin") && + !fsutil.IsCharacterDevice("/dev/stdout") && + os.Getenv("FAKETTY") == "" { fmtc.DisableColors = true rawOutput = true }