不要怂,就是干,撸起袖子干!

Commit cc197a35 by Mick Hansen

Merge pull request #1709 from edgarsilva/master

Fixes issue with options file (--options-path) relative path not working.
2 parents 798ecb12 35d18dac
Showing with 10 additions and 2 deletions
...@@ -18,7 +18,7 @@ var configuration = { ...@@ -18,7 +18,7 @@ var configuration = {
var loadDefaultOptions = function(pathToOptionsFile) { var loadDefaultOptions = function(pathToOptionsFile) {
try { try {
var options = require(path.resolve(process.cwd(), '/', pathToOptionsFile)) var options = require(pathToOptionsFile);
Object.keys(options).forEach(function(key) { Object.keys(options).forEach(function(key) {
program[key] = options[key] program[key] = options[key]
...@@ -194,7 +194,15 @@ program ...@@ -194,7 +194,15 @@ program
.parse(process.argv) .parse(process.argv)
if(typeof program.optionsPath === 'string') { if(typeof program.optionsPath === 'string') {
loadDefaultOptions(program.optionsPath); var optionsFilesPath = null;
if (isRelativePath(program.optionsPath)) {
optionsFilePath = path.join(process.cwd(), program.optionsPath);
} else {
optionsFilePath = program.optionsPath;
}
loadDefaultOptions(optionsFilePath);
} }
if(typeof program.config === 'string') { if(typeof program.config === 'string') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!