fix: allow plugins to set environment variables to be used by other plugins
This commit is contained in:
committed by
Gregor Martynus
parent
8ce2d6e834
commit
68f7e928f9
@@ -6,7 +6,7 @@ const PLUGINS_DEFINITIONS = require('../definitions/plugins');
|
||||
const {loadPlugin, parseConfig} = require('./utils');
|
||||
|
||||
module.exports = (context, type, pluginOpt, pluginsPath) => {
|
||||
const {stdout, stderr, options, logger} = context;
|
||||
const {stdout, stderr, options, logger, env} = context;
|
||||
if (!pluginOpt) {
|
||||
return noop;
|
||||
}
|
||||
@@ -32,10 +32,11 @@ module.exports = (context, type, pluginOpt, pluginsPath) => {
|
||||
if (!input.options.dryRun || dryRun) {
|
||||
logger.log(`Start step "${type}" of plugin "${pluginName}"`);
|
||||
const result = await func({
|
||||
...cloneDeep(omit(input, ['stdout', 'stderr', 'logger'])),
|
||||
...cloneDeep(omit(input, ['stdout', 'stderr', 'logger', 'env'])),
|
||||
stdout,
|
||||
stderr,
|
||||
logger: logger.scope(logger.scopeName, pluginName),
|
||||
env,
|
||||
});
|
||||
if (outputValidator && !outputValidator(result)) {
|
||||
throw getError(`E${type.toUpperCase()}OUTPUT`, {result, pluginName});
|
||||
|
||||
Reference in New Issue
Block a user