[ospec] don't output colors when pipe or file redirection is used (#2143)
This commit is contained in:
parent
ca1bce9732
commit
43053c6088
2 changed files with 3 additions and 2 deletions
|
|
@ -259,7 +259,7 @@ else window.o = m()
|
|||
try {return JSON.stringify(value)} catch (e) {return String(value)}
|
||||
}
|
||||
function highlight(message) {
|
||||
return hasProcess ? "\x1b[31m" + message + "\x1b[0m" : "%c" + message + "%c "
|
||||
return hasProcess ? (process.stdout.isTTY ? "\x1b[31m" + message + "\x1b[0m" : message) : "%c" + message + "%c "
|
||||
}
|
||||
|
||||
o.report = function (results) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue