mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2025-01-03 18:32:11 +01:00
23 lines
505 B
JavaScript
Executable file
23 lines
505 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
var GitStats = require("../lib");
|
|
|
|
switch (process.argv[2]) {
|
|
case "--record":
|
|
var data = process.argv[3];
|
|
console.log(data);
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (e) {
|
|
throw e;
|
|
}
|
|
GitStats.record(data, function (err) {
|
|
if (err) { throw err; }
|
|
});
|
|
break;
|
|
default:
|
|
GitStats.get(function (err, data) {
|
|
console.log(err || data);
|
|
});
|
|
break;
|
|
}
|