Skip to content
Permalink
Browse files

fix(core): disable the packagerConfig.all option (#510)

ISSUES CLOSED: #508
  • Loading branch information
malept authored and MarshallOfSound committed May 18, 2018
1 parent 8a32f0c commit ce3635621dd963079e34652dbfd228d41383f243
Showing with 14 additions and 0 deletions.
  1. +4 −0 packages/api/core/src/api/package.ts
  2. +10 −0 packages/api/core/test/slow/api_spec_slow.ts
@@ -175,6 +175,10 @@ export default async ({
});
packageOpts.quiet = true;

if (packageOpts.all) {
throw new Error('config.forge.packagerConfig.all is not supported by Electron Forge');
}

if (!packageJSON.version && !packageOpts.appVersion) {
// eslint-disable-next-line max-len
warn(interactive, 'Please set "version" or "config.forge.packagerConfig.appVersion" in your application\'s package.json so auto-updates work properly'.yellow);
@@ -214,6 +214,16 @@ describe(`electron-forge API (with installer=${nodeInstaller})`, () => {
await fs.writeJson(path.resolve(dir, 'package.json'), packageJSON);
});

it('throws an error when all is set', async () => {
let packageJSON = await readPackageJSON(dir);
packageJSON.config.forge.packagerConfig.all = true;
await fs.writeJson(path.join(dir, 'package.json'), packageJSON);
await expect(forge.package({ dir })).to.eventually.be.rejectedWith(/packagerConfig\.all is not supported by Electron Forge/);
packageJSON = await readPackageJSON(dir);
delete packageJSON.config.forge.packagerConfig.all;
await fs.writeJson(path.join(dir, 'package.json'), packageJSON);
});

it('can package to outDir without errors', async () => {
const outDir = `${dir}/foo`;

0 comments on commit ce36356

Please sign in to comment.
You can’t perform that action at this time.