From 3b001b1d0840c28d9fe1026e3480b1c3b3f8d726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Sun, 1 Feb 2015 10:46:51 +0200 Subject: [PATCH] Handling no-ansi option in bin script --- bin/git-stats | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/git-stats b/bin/git-stats index 152cb3a..3f99998 100755 --- a/bin/git-stats +++ b/bin/git-stats @@ -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; }