fix: set default path to generateNotes object config

This commit is contained in:
Pierre Vanduynslager
2018-07-10 15:50:24 -04:00
parent 24ce560065
commit d8e59cce53
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -17,9 +17,10 @@ module.exports = (options, pluginsPath, logger) => {
if (isUndefined(options[type])) {
pluginConfs = def;
} else {
const defaultPaths = castArray(def);
// If an object is passed and the path is missing, set the default one for single plugins
if (isPlainObject(options[type]) && !options[type].path && castArray(def).length === 1) {
options[type].path = def;
if (isPlainObject(options[type]) && !options[type].path && defaultPaths.length === 1) {
[options[type].path] = defaultPaths;
}
if (configValidator && !configValidator(options[type])) {
errors.push(getError('EPLUGINCONF', {type, pluginConf: options[type]}));