Remove ANSI colors from console output.

This commit is contained in:
Andras Bacsai 2023-11-07 14:40:58 +01:00
parent 18e98aaf52
commit 332a0b9e04
2 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,7 @@ class GetLogs extends Component
public int $numberOfLines = 100;
public function doSomethingWithThisChunkOfOutput($output)
{
$this->outputs .= $output;
$this->outputs .= removeAnsiColors($output);
}
public function instantSave()
{

View File

@ -501,3 +501,6 @@ function generateDeployWebhook($resource) {
$url = $api . $endpoint . "?uuid=$uuid&force=false";
return $url;
}
function removeAnsiColors($text) {
return preg_replace('/\e[[][A-Za-z0-9];?[0-9]*m?/', '', $text);
}