mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
* Only colorise if we are attached to a terminal.
This commit is contained in:
parent
b87b9c0d1f
commit
cec2be64f3
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,8 @@
|
|||
#include <ctime>
|
||||
#include <algorithm>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
srcNixExprDrvs,
|
||||
|
@ -711,6 +713,7 @@ static VersionDiff compareVersionAgainstSet(
|
|||
|
||||
static string colorString(const string & s)
|
||||
{
|
||||
if (!isatty(STDOUT_FILENO)) return s;
|
||||
return "\e[1;31m" + s + "\e[0m";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue