Send the radius and no_ansi values

This commit is contained in:
Ionică Bizău 2015-05-28 19:56:32 +03:00
parent 2c26a37c9a
commit 25ad4f7afd

View file

@ -155,11 +155,11 @@ GitStats.iterateDays = function (data, callback) {
} }
// Merge the defaults // Merge the defaults
data = Ul.merge({ data = Ul.merge(data, {
end: Moment() end: Moment()
, start: Moment().subtract(1, "years") , start: Moment().subtract(1, "years")
, format: DATE_FORMAT , format: DATE_FORMAT
}, data); });
var start = data.start var start = data.start
, end = data.end , end = data.end
@ -409,6 +409,10 @@ GitStats.authorsPie = function (options, callback) {
}; };
} }
options = Ul.merge(options, {
radius: process.stdout.rows / 2 || 20
});
if (!IsThere.sync(options.repo)) { if (!IsThere.sync(options.repo)) {
return callback(new Error("Repository is missing.")); return callback(new Error("Repository is missing."));
} }
@ -432,9 +436,10 @@ GitStats.authorsPie = function (options, callback) {
}; };
}); });
pie = new CliPie(20, pieData, { pie = new CliPie(options.radius, pieData, {
legend: true legend: true
, flat: true , flat: true
, no_ansi: options.no_ansi
}); });
callback(null, pie.toString()); callback(null, pie.toString());