From bca433fbecd04d6b670ccce65e7c6ac199316411 Mon Sep 17 00:00:00 2001 From: Ben Hollomon Date: Wed, 17 Jan 2018 08:54:58 -0600 Subject: [PATCH] Fixed bug that was causing data path from config file to not be used. Corrected config file path in help documentation. --- bin/git-stats | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/git-stats b/bin/git-stats index 9149f66..82cd40c 100755 --- a/bin/git-stats +++ b/bin/git-stats @@ -85,7 +85,7 @@ new Tilda(`${__dirname}/../package.json`, { , "git-stats -s '1 January 2012' # All the commits from 1 January 2012 to now" , "git-stats -s '1 January 2012' -u '31 December 2012' # All the commits from 2012" ] - , notes: "Your commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.json to specify different defaults." + , notes: "Your commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.js to specify different defaults." }).main(action => { let recordOpt = action.options.record @@ -101,13 +101,8 @@ new Tilda(`${__dirname}/../package.json`, { let options = {}; - // Handle data path - if (dataPathOpt.is_provided) { - GitStats.path = Abs(dataPathOpt.value); - GitStats.config.data_path = GitStats.path; - if (!IsThere(GitStats.path)) { - Logger.log("Cannot find the the specified data path file.", "warn"); - } + if(GitStats.config.path) { + dataPathOpt.is_provided = true; } if (GitStats.config.authors) { @@ -118,6 +113,17 @@ new Tilda(`${__dirname}/../package.json`, { globalActivityOpt.is_provided = true; } + // Handle data path + if (dataPathOpt.is_provided) { + if (IsThere(dataPathOpt.value)) { + GitStats.path = Abs(dataPathOpt.value); + GitStats.config.data_path = GitStats.path; + } + else { + Logger.log("Cannot find the the specified data path file.", "warn"); + } + } + // --record if (recordOpt.is_provided) { try {