mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 21:32:10 +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
|
// Dependencies
|
||||||
var GitStats = require("../lib")
|
var GitStats = require("../lib")
|
||||||
|
, Moment = require("moment")
|
||||||
, Fs = require("fs")
|
, Fs = require("fs")
|
||||||
, AnsiParser = require("ansi-parser")
|
, AnsiParser = require("ansi-parser")
|
||||||
, Couleurs = require("couleurs")()
|
, Couleurs = require("couleurs")()
|
||||||
|
@ -58,7 +59,22 @@ switch (process.argv[2]) {
|
||||||
console.log(require("../package.json").version);
|
console.log(require("../package.json").version);
|
||||||
break;
|
break;
|
||||||
default:
|
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"); }
|
if (err) { return Logger.log(err, "error"); }
|
||||||
data = AnsiParser.removeAnsi(data);
|
data = AnsiParser.removeAnsi(data);
|
||||||
if (process.argv.indexOf("--no-ansi") === -1) {
|
if (process.argv.indexOf("--no-ansi") === -1) {
|
||||||
|
|
Loading…
Reference in a new issue