Skip to content

Commit

Permalink
Fix custom config path not being resolved
Browse files Browse the repository at this point in the history
The config path will now be resolved relative to process.cwd().
  • Loading branch information
Rui Marinho committed Jun 2, 2014
1 parent c6ca93d commit 15a728a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/helpers/config-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var args = require('yargs').argv

module.exports = {
getConfigFile: function() {
if (args.config) {
return path.resolve(process.cwd(), args.config)
}

return path.resolve(process.cwd(), 'config', 'config.json')
},

Expand Down Expand Up @@ -60,7 +64,7 @@ module.exports = {
try {
this.config = require(this.getConfigFile())
} catch(e) {
throw new Error('Error reading "' + this.relativeConfigFile() + '".')
throw new Error('Error reading "' + this.relativeConfigFile() + '". Error: ' + e.message)
}
}

Expand Down

0 comments on commit 15a728a

Please sign in to comment.