feat: pass cwd and env context to plugins
- Allow to run semantic-release (via API) from anywhere passing the current working directory. - Allows to simplify the tests and to run them in parallel in both the core and plugins.
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
module.exports = (pluginConfig, options) => options;
|
||||
module.exports = (pluginConfig, context) => context;
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
module.exports = (pluginConfig, {env, logger}) => {
|
||||
console.log(`Console: Exposing token ${env.MY_TOKEN}`);
|
||||
logger.log(`Log: Exposing token ${env.MY_TOKEN}`);
|
||||
logger.error(`Error: Console token ${env.MY_TOKEN}`);
|
||||
throw new Error(`Throw error: Exposing ${env.MY_TOKEN}`);
|
||||
};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
module.exports = (pluginConfig, options) => ({pluginConfig, options});
|
||||
module.exports = (pluginConfig, context) => ({pluginConfig, context});
|
||||
|
||||
Reference in New Issue
Block a user