allowed for specifying not-yet-existent config file
This commit is contained in:
parent
78c1fb344e
commit
4d49e0fb63
|
@ -87,7 +87,17 @@ function checkConfigLocation(cwd, configFile) {
|
|||
var prom;
|
||||
if (configFile) {
|
||||
filename = path.resolve(cwd, configFile);
|
||||
prom = fs.readFileAsync(filename);
|
||||
prom = fs.readFileAsync(filename)
|
||||
.catch(function (err) {
|
||||
if (err.code !== 'ENOENT') {
|
||||
return PromiseA.reject(err);
|
||||
}
|
||||
if (path.extname(filename) === '.json') {
|
||||
return '{}';
|
||||
}
|
||||
return '';
|
||||
})
|
||||
;
|
||||
} else {
|
||||
prom = PromiseA.reject('blah')
|
||||
.catch(function () {
|
||||
|
|
Loading…
Reference in New Issue