Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0e18af

Browse files
committed
In case there's no config file, do not fail
1 parent b6d11d8 commit f0e18af

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/generate/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,15 @@ var generate = function(options) {
9393

9494
// Read config file
9595
.then(function() {
96-
var _config = require(path.resolve(options.input, options.configFile));
96+
try {
97+
var _config = require(path.resolve(options.input, options.configFile));
9798

98-
_.extend(options, _.omit(_config, 'input', 'configFile', 'defaultsPlugins'));
99-
100-
return Q();
99+
_.extend(options, _.omit(_config, 'input', 'configFile', 'defaultsPlugins'));
100+
}
101+
catch(err) {
102+
// No config file: not a big deal
103+
return Q();
104+
}
101105
})
102106

103107
// Read readme

0 commit comments

Comments
 (0)