Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: dart/utils/compiler/build_helper.dart

Issue 10910006: Improve detection of when to use colors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/utils/compiler/build_helper.dart
diff --git a/dart/utils/compiler/build_helper.dart b/dart/utils/compiler/build_helper.dart
index 27dd650107fd9e3b1ecf9f867f85b0eb3305e86d..e4fa9f936a4c7512dfe1cd96487a3c0218252b80 100644
--- a/dart/utils/compiler/build_helper.dart
+++ b/dart/utils/compiler/build_helper.dart
@@ -103,12 +103,15 @@ List<String> buildScript(String name,
# BSD-style license that can be found in the LICENSE file.
BIN_DIR=`dirname \$0`
-NO_COLORS="--no-colors"
+unset COLORS
if test -t 1; then
- # Enable colors if stdout is a terminal.
- unset NO_COLORS
+ # Stdout is a terminal.
+ if test 8 -le `tput colors`; then
+ # Stdout has at least 8 colors, so enable colors.
+ COLORS="--colors"
+ fi
fi
-exec \$BIN_DIR/dart$options \$BIN_DIR/$path \$NO_COLORS "\$@"
+exec \$BIN_DIR/dart$options \$BIN_DIR/$path \$COLORS "\$@"
''',
'''
@echo off
@@ -123,6 +126,6 @@ if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%
set arguments=%*
-"%SCRIPTPATH%\dart.exe"$options "%SCRIPTPATH%$pathWin" --no-colors %arguments%
+"%SCRIPTPATH%\dart.exe"$options "%SCRIPTPATH%$pathWin" %arguments%
'''.replaceAll('\n', '\r\n')];
}
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698