Skip to content

Commit 0752572

Browse files
committed
fix colorized output
1 parent 8b642e7 commit 0752572

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source-map-support.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var SourceMapConsumer = require('source-map').SourceMapConsumer;
22
var path = require('path');
3+
var util = require('util');
34

45
var fs;
56
try {
@@ -472,7 +473,13 @@ function printErrorAndExit (error) {
472473
console.error(source);
473474
}
474475

475-
console.error(error);
476+
// Matches node's behavior for colorized output
477+
console.error(
478+
util.inspect(error, {
479+
customInspect: false,
480+
colors: process.stderr.isTTY
481+
})
482+
);
476483
process.exit(1);
477484
}
478485

0 commit comments

Comments
 (0)