mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 21:32:10 +01:00
Handling no-ansi option in bin script
This commit is contained in:
parent
d8bc72f267
commit
3b001b1d08
1 changed files with 13 additions and 0 deletions
|
@ -3,8 +3,18 @@
|
|||
// Dependencies
|
||||
var GitStats = require("../lib")
|
||||
, Fs = require("fs")
|
||||
, AnsiParser = require("ansi-parser")
|
||||
, Couleurs = require("couleurs")()
|
||||
;
|
||||
|
||||
const SQUARES = {
|
||||
"⬚": Couleurs.fg("⬚", "#eee")
|
||||
, "▢": Couleurs.fg("▢", "#eee")
|
||||
, "▤": Couleurs.fg("▤", "#8cc665")
|
||||
, "▣": Couleurs.fg("▣", "#44a340")
|
||||
, "⬛": Couleurs.fg("▣", "#1e6823")
|
||||
};
|
||||
|
||||
// CLI options
|
||||
switch (process.argv[2]) {
|
||||
case "--record":
|
||||
|
@ -27,6 +37,9 @@ switch (process.argv[2]) {
|
|||
default:
|
||||
GitStats.ansiCalendar(function (err, data) {
|
||||
console.log(err || data);
|
||||
if (process.argv.indexOf("--no-ansi") !== -1) {
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue