Skip to content

Commit bca433f

Browse files
committed
Fixed bug that was causing data path from config file to not be used.
Corrected config file path in help documentation.
1 parent 11c37ae commit bca433f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

bin/git-stats

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ new Tilda(`${__dirname}/../package.json`, {
8585
, "git-stats -s '1 January 2012' # All the commits from 1 January 2012 to now"
8686
, "git-stats -s '1 January 2012' -u '31 December 2012' # All the commits from 2012"
8787
]
88-
, notes: "Your commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.json to specify different defaults."
88+
, notes: "Your commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.js to specify different defaults."
8989
}).main(action => {
9090

9191
let recordOpt = action.options.record
@@ -101,13 +101,8 @@ new Tilda(`${__dirname}/../package.json`, {
101101

102102
let options = {};
103103

104-
// Handle data path
105-
if (dataPathOpt.is_provided) {
106-
GitStats.path = Abs(dataPathOpt.value);
107-
GitStats.config.data_path = GitStats.path;
108-
if (!IsThere(GitStats.path)) {
109-
Logger.log("Cannot find the the specified data path file.", "warn");
110-
}
104+
if(GitStats.config.path) {
105+
dataPathOpt.is_provided = true;
111106
}
112107

113108
if (GitStats.config.authors) {
@@ -118,6 +113,17 @@ new Tilda(`${__dirname}/../package.json`, {
118113
globalActivityOpt.is_provided = true;
119114
}
120115

116+
// Handle data path
117+
if (dataPathOpt.is_provided) {
118+
if (IsThere(dataPathOpt.value)) {
119+
GitStats.path = Abs(dataPathOpt.value);
120+
GitStats.config.data_path = GitStats.path;
121+
}
122+
else {
123+
Logger.log("Cannot find the the specified data path file.", "warn");
124+
}
125+
}
126+
121127
// --record
122128
if (recordOpt.is_provided) {
123129
try {

0 commit comments

Comments
 (0)