mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 13:22:11 +01:00
Collect data in a given range
This commit is contained in:
parent
ea7a525e53
commit
6ee43a45bc
1 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Dependencies
|
||||
var GitStats = require("../lib")
|
||||
, Moment = require("moment")
|
||||
, Fs = require("fs")
|
||||
, AnsiParser = require("ansi-parser")
|
||||
, Couleurs = require("couleurs")()
|
||||
|
@ -58,7 +59,22 @@ switch (process.argv[2]) {
|
|||
console.log(require("../package.json").version);
|
||||
break;
|
||||
default:
|
||||
GitStats.ansiCalendar(function (err, data) {
|
||||
var options = {
|
||||
start: Moment().subtract(1, "years")
|
||||
, end: Moment()
|
||||
};
|
||||
|
||||
if (process.argv.length !== 2) {
|
||||
if (process.argv[2]) {
|
||||
options.start = Moment(process.argv[2]);
|
||||
}
|
||||
|
||||
if (process.argv[3]) {
|
||||
options.end = Moment(process.argv[3]);
|
||||
}
|
||||
}
|
||||
|
||||
GitStats.ansiCalendar(options, function (err, data) {
|
||||
if (err) { return Logger.log(err, "error"); }
|
||||
data = AnsiParser.removeAnsi(data);
|
||||
if (process.argv.indexOf("--no-ansi") === -1) {
|
||||
|
|
Loading…
Reference in a new issue