Skip to content

Commit aeb7c54

Browse files
committed
More simplified
1 parent d0f7596 commit aeb7c54

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

tools/hxcpp/Log.hx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class Log
136136
if (colorSupported == null)
137137
{
138138
var term = Sys.getEnv("TERM");
139-
var colorTerm = Sys.getEnv("COLORTERM");
140139

141140
if (term == "dumb")
142141
{
@@ -166,32 +165,21 @@ class Log
166165
}
167166
}
168167

169-
if (colorSupported != true)
168+
if (colorSupported != true && Sys.getEnv("CI_NAME") == "codeship")
170169
{
171-
if (Sys.getEnv("CI_NAME") == "codeship")
172-
{
173-
colorSupported = true;
174-
}
170+
colorSupported = true;
175171
}
176172
}
177173

178-
if (colorSupported != true)
174+
if (colorSupported != true && Sys.getEnv("TEAMCITY_VERSION") != null)
179175
{
180-
if (Sys.getEnv("TEAMCITY_VERSION") != null)
181-
{
182-
colorSupported = ~/^9\.(0*[1-9]\d*)\.|\d{2,}\./.match(Sys.getEnv("TEAMCITY_VERSION"));
183-
}
184-
else if (colorTerm == "truecolor")
185-
{
186-
colorSupported = true;
187-
}
176+
colorSupported = ~/^9\.(0*[1-9]\d*)\.|\d{2,}\./.match(Sys.getEnv("TEAMCITY_VERSION"));
188177
}
189178

190-
if (colorSupported != true)
179+
if (colorSupported != true && term != null)
191180
{
192181
colorSupported = ~/(?i)-256(color)?$/.match(term)
193-
|| ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term)
194-
|| (colorTerm != null);
182+
|| ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term);
195183
}
196184

197185
if (colorSupported != true)

0 commit comments

Comments
 (0)