Handling no-ansi option in bin script

This commit is contained in:
Ionică Bizău 2015-02-01 10:46:51 +02:00
parent d8bc72f267
commit 3b001b1d08

View file

@ -3,8 +3,18 @@
// Dependencies // Dependencies
var GitStats = require("../lib") var GitStats = require("../lib")
, Fs = require("fs") , 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 // CLI options
switch (process.argv[2]) { switch (process.argv[2]) {
case "--record": case "--record":
@ -27,6 +37,9 @@ switch (process.argv[2]) {
default: default:
GitStats.ansiCalendar(function (err, data) { GitStats.ansiCalendar(function (err, data) {
console.log(err || data); console.log(err || data);
if (process.argv.indexOf("--no-ansi") !== -1) {
}
}); });
break; break;
} }