mirror of
https://github.com/bower/bower.git
synced 2026-02-11 06:24:57 -05:00
Minor CS fixes.
This commit is contained in:
@@ -47,7 +47,7 @@ function renderTagPlusLabel(data) {
|
||||
|
||||
// -------------------------
|
||||
|
||||
var colorful = {
|
||||
colorful = {
|
||||
begin: function () {},
|
||||
end: function () {},
|
||||
error: function (err) {
|
||||
@@ -66,13 +66,10 @@ var colorful = {
|
||||
this._write(process.stderr, str);
|
||||
},
|
||||
data: function (data) {
|
||||
var outputStream;
|
||||
|
||||
data.data = data.data || '';
|
||||
|
||||
var outputStream = process.stdout;
|
||||
|
||||
if (data.level === 'warn') {
|
||||
outputStream = process.stderr;
|
||||
}
|
||||
outputStream = data.level === 'warn' ? process.stderr : process.stdout;
|
||||
|
||||
this._write(outputStream, 'bower ' + renderTagPlusLabel(data) + ' ' + data.data + '\n');
|
||||
},
|
||||
@@ -83,15 +80,15 @@ var colorful = {
|
||||
|
||||
this.data(data);
|
||||
},
|
||||
_write: function (channel, str) {
|
||||
channel.write(str);
|
||||
_write: function (outputStream, str) {
|
||||
outputStream.write(str);
|
||||
}
|
||||
};
|
||||
|
||||
// The colorless variant simply removes the colors from the write method
|
||||
var colorless = mout.object.mixIn({}, colorful, {
|
||||
_write: function (channel, str) {
|
||||
channel.write(uncolor(str));
|
||||
colorless = mout.object.mixIn({}, colorful, {
|
||||
_write: function (outputStream, str) {
|
||||
outputStream.write(uncolor(str));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
var json;
|
||||
var nrData = 0;
|
||||
|
||||
function uncolor(str) {
|
||||
return str.replace(/\x1B\[\d+m/g, '');
|
||||
}
|
||||
@@ -8,11 +11,9 @@ function stringify(data) {
|
||||
|
||||
// -------------------------
|
||||
|
||||
var nrData = 0;
|
||||
|
||||
// In the json output, everything goes to stderr except
|
||||
// the final command result that goes to stdout.
|
||||
var json = {
|
||||
json = {
|
||||
begin: function () {
|
||||
process.stderr.write('[');
|
||||
},
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
var silent;
|
||||
|
||||
function empty() {}
|
||||
|
||||
// -------------------------
|
||||
|
||||
var silent = {
|
||||
silent = {
|
||||
begin: empty,
|
||||
end: empty,
|
||||
error: empty,
|
||||
|
||||
Reference in New Issue
Block a user