diff --git a/lib/multiSemanticRelease.js b/lib/multiSemanticRelease.js index 233c1807..25bb6f1f 100644 --- a/lib/multiSemanticRelease.js +++ b/lib/multiSemanticRelease.js @@ -1,6 +1,6 @@ const { dirname } = require("path"); const semanticRelease = require("semantic-release"); -const { uniq, omit } = require("lodash"); +const { uniq } = require("lodash"); const { check } = require("./blork"); const getLogger = require("./getLogger"); const getSynchronizer = require("./getSynchronizer"); @@ -64,8 +64,7 @@ async function multiSemanticRelease( // Vars. const globalOptions = await getConfig(cwd); - const options = Object.assign({}, globalOptions, inputOptions); - const multiContext = { options, cwd, env, stdout, stderr }; + const multiContext = { globalOptions, inputOptions, cwd, env, stdout, stderr }; // Load packages from paths. const packages = await Promise.all(paths.map((path) => getPackage(path, multiContext))); @@ -118,7 +117,7 @@ module.exports = multiSemanticRelease; * * @internal */ -async function getPackage(path, { options: globalOptions, env, cwd, stdout, stderr }) { +async function getPackage(path, { globalOptions, inputOptions, env, cwd, stdout, stderr }) { // Make path absolute. path = cleanPath(path, cwd); const dir = dirname(path); @@ -136,11 +135,11 @@ async function getPackage(path, { options: globalOptions, env, cwd, stdout, stde }); // Load the package-specific options. - const pkgOptions = omit(await getConfig(dir), "plugins", "tagFormat"); + const pkgOptions = await getConfig(dir); // The 'final options' are the global options merged with package-specific options. // We merge this ourselves because package-specific options can override global options. - const finalOptions = Object.assign({}, globalOptions, pkgOptions); + const finalOptions = Object.assign({}, globalOptions, pkgOptions, inputOptions); // Make a fake logger so semantic-release's get-config doesn't fail. const logger = { error() {}, log() {} }; diff --git a/test/lib/multiSemanticRelease.test.js b/test/lib/multiSemanticRelease.test.js index 99cfc90f..dc0a56c8 100644 --- a/test/lib/multiSemanticRelease.test.js +++ b/test/lib/multiSemanticRelease.test.js @@ -786,6 +786,7 @@ describe("multiSemanticRelease()", () => { expect(false).toBe(true); } catch (e) { // Error bubbles up through semantic-release and multi-semantic-release and out. + expect(e.message).toBe("NOPE"); } });