fix: log all core verification errors
This commit is contained in:
+11
-3
@@ -1,11 +1,13 @@
|
||||
const {isArray, isObject, omit} = require('lodash');
|
||||
const AggregateError = require('aggregate-error');
|
||||
const SemanticReleaseError = require('@semantic-release/error');
|
||||
const PLUGINS_DEFINITION = require('./definitions');
|
||||
const pipeline = require('./pipeline');
|
||||
const normalize = require('./normalize');
|
||||
|
||||
module.exports = (options, pluginsPath, logger) =>
|
||||
Object.keys(PLUGINS_DEFINITION).reduce((plugins, pluginType) => {
|
||||
module.exports = (options, pluginsPath, logger) => {
|
||||
const errors = [];
|
||||
const plugins = Object.keys(PLUGINS_DEFINITION).reduce((plugins, pluginType) => {
|
||||
const {config, output, default: def} = PLUGINS_DEFINITION[pluginType];
|
||||
let pluginConfs;
|
||||
if (options[pluginType]) {
|
||||
@@ -14,7 +16,8 @@ module.exports = (options, pluginsPath, logger) =>
|
||||
options[pluginType].path = def;
|
||||
}
|
||||
if (config && !config.validator(options[pluginType])) {
|
||||
throw new SemanticReleaseError(config.message, 'EPLUGINCONF');
|
||||
errors.push(new SemanticReleaseError(config.message, 'EPLUGINCONF'));
|
||||
return plugins;
|
||||
}
|
||||
pluginConfs = options[pluginType];
|
||||
} else {
|
||||
@@ -29,3 +32,8 @@ module.exports = (options, pluginsPath, logger) =>
|
||||
|
||||
return plugins;
|
||||
}, {});
|
||||
if (errors.length > 0) {
|
||||
throw new AggregateError(errors);
|
||||
}
|
||||
return plugins;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user