From 50f7910e8002ad0de9b7b700bc7bc48b4fdc30b8 Mon Sep 17 00:00:00 2001 From: godofredoc Date: Tue, 4 Apr 2023 11:41:47 -0700 Subject: [PATCH] Do not use colors in output if running from CI. (#122645) Do not use colors in output if running from CI. --- dev/bots/utils.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/bots/utils.dart b/dev/bots/utils.dart index 24f0298c4c..2cd908a983 100644 --- a/dev/bots/utils.dart +++ b/dev/bots/utils.dart @@ -12,7 +12,10 @@ import 'package:meta/meta.dart'; const Duration _quietTimeout = Duration(minutes: 10); // how long the output should be hidden between calls to printProgress before just being verbose -final bool hasColor = stdout.supportsAnsiEscapes; +// If running from LUCI set to False. +final bool isLuci = Platform.environment['LUCI_CI'] == 'True'; +final bool hasColor = stdout.supportsAnsiEscapes && !isLuci; + final String bold = hasColor ? '\x1B[1m' : ''; // shard titles final String red = hasColor ? '\x1B[31m' : ''; // errors