mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 21:32:10 +01:00
30 lines
724 B
JavaScript
Executable file
30 lines
724 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
var GitStats = require("../lib");
|
|
|
|
switch (process.argv[2]) {
|
|
case "--record":
|
|
var data = process.argv[3].replace(/^\"|\"$/g, "");
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (e) {
|
|
throw e;
|
|
}
|
|
GitStats.record(data, function (err) {
|
|
if (err) { throw err; }
|
|
});
|
|
break;
|
|
case "--help":
|
|
// TODO
|
|
console.log(
|
|
"git-stats"
|
|
+ "\nA GitHub-like contributions calendar, but locally, with all your git commits."
|
|
+ "\n"
|
|
);
|
|
break;
|
|
default:
|
|
GitStats.ansiCalendar(function (err, data) {
|
|
console.log(err || data);
|
|
});
|
|
break;
|
|
}
|