Skip to content

Commit 15a728a

Browse files
author
Rui Marinho
committed
Fix custom config path not being resolved
The config path will now be resolved relative to process.cwd().
1 parent c6ca93d commit 15a728a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/helpers/config-helper.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ var args = require('yargs').argv
66

77
module.exports = {
88
getConfigFile: function() {
9+
if (args.config) {
10+
return path.resolve(process.cwd(), args.config)
11+
}
12+
913
return path.resolve(process.cwd(), 'config', 'config.json')
1014
},
1115

@@ -60,7 +64,7 @@ module.exports = {
6064
try {
6165
this.config = require(this.getConfigFile())
6266
} catch(e) {
63-
throw new Error('Error reading "' + this.relativeConfigFile() + '".')
67+
throw new Error('Error reading "' + this.relativeConfigFile() + '". Error: ' + e.message)
6468
}
6569
}
6670

0 commit comments

Comments
 (0)