aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-Allow-forcing-of-colored-output.patch
blob: 0606dcff85ba6f8f1dc09c7962ade71f56ecdbf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 0a79fc62c9d0aa30eb42ff4251701eee2368309d Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@alpinelinux.org>
Date: Mon, 25 Feb 2019 23:02:09 +0000
Subject: [PATCH] Allow forcing of colored output

In some cases (ie drone ci) there is no tty available but its still
possible to display colors in the webui.
---
 functions.sh.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/functions.sh.in b/functions.sh.in
index 4f2c023..ea21f25 100644
--- a/functions.sh.in
+++ b/functions.sh.in
@@ -243,7 +243,9 @@ enable_colors() {
 	BLUE="\033[1;34m"
 }
 
-if [ -n "$USE_COLORS" ] && [ -t 1 ]; then
+if [ "$USE_COLORS" = force ]; then
+	enable_colors
+elif [ -n "$USE_COLORS" ] && [ -t 1 ]; then
 	enable_colors
 else
 	disable_colors
-- 
2.21.0