Skip to content

Commit

Permalink
More simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
MAJigsaw77 authored Aug 30, 2024
1 parent 7a2291b commit 5d60aba
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions tools/hxcpp/Log.hx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class Log
if (colorSupported == null)
{
var term = Sys.getEnv("TERM");
var colorTerm = Sys.getEnv("COLORTERM");

if (term == "dumb")
{
Expand Down Expand Up @@ -159,32 +158,21 @@ class Log
}
}

if (colorSupported != true)
if (colorSupported != true && Sys.getEnv("CI_NAME") == "codeship")
{
if (Sys.getEnv("CI_NAME") == "codeship")
{
colorSupported = true;
}
colorSupported = true;
}
}

if (colorSupported != true)
if (colorSupported != true && Sys.getEnv("TEAMCITY_VERSION") != null)
{
if (Sys.getEnv("TEAMCITY_VERSION") != null)
{
colorSupported = ~/^9\.(0*[1-9]\d*)\.|\d{2,}\./.match(Sys.getEnv("TEAMCITY_VERSION"));
}
else if (colorTerm == "truecolor")
{
colorSupported = true;
}
colorSupported = ~/^9\.(0*[1-9]\d*)\.|\d{2,}\./.match(Sys.getEnv("TEAMCITY_VERSION"));
}

if (colorSupported != true)
if (colorSupported != true && term != null)
{
colorSupported = ~/(?i)-256(color)?$/.match(term)
|| ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term)
|| (colorTerm != null);
|| ~/(?i)^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/.match(term);
}

if (colorSupported != true)
Expand Down

0 comments on commit 5d60aba

Please sign in to comment.