mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 21:32:10 +01:00
Call the library methods
This commit is contained in:
parent
8b57202cf1
commit
708106f90f
1 changed files with 20 additions and 0 deletions
|
@ -1,2 +1,22 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var GitStats = require("../lib");
|
||||
|
||||
switch (process.argv[2]) {
|
||||
case "--record":
|
||||
var data = process.argv[3];
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue