Skip to content
Permalink
Browse files

fix(packager): package spinner isn't defined when asar.unpack is checked

ISSUES CLOSED: #396
  • Loading branch information
malept authored and MarshallOfSound committed Dec 24, 2017
1 parent 1a1884d commit 435e83d016d91984aa46b1413651eec522d333cc
Showing with 10 additions and 1 deletion.
  1. +0 −1 src/api/package.js
  2. +10 −0 test/slow/api_spec_slow.js
@@ -139,7 +139,6 @@ export default async (providedOptions = {}) => {
});
packageOpts.quiet = true;
if (typeof packageOpts.asar === 'object' && packageOpts.asar.unpack) {
packagerSpinner.fail();
throw new Error('electron-compile does not support asar.unpack yet. Please use asar.unpackDir');
}

@@ -267,6 +267,16 @@ describe(`electron-forge API (with installer=${nodeInstaller})`, () => {
await fs.remove(path.resolve(dir, 'out'));
});

it('throws an error when asar.unpack is set', async () => {
let packageJSON = await readPackageJSON(dir);
packageJSON.config.forge.electronPackagerConfig.asar = { unpack: 'somedir/**' };
await fs.writeJson(path.join(dir, 'package.json'), packageJSON);
await expect(forge.package({ dir })).to.eventually.be.rejectedWith(/electron-compile does not support asar\.unpack/);
packageJSON = await readPackageJSON(dir);
delete packageJSON.config.forge.electronPackagerConfig.asar;
await fs.writeJson(path.join(dir, 'package.json'), packageJSON);
});

it('can package without errors with native pre-gyp deps installed', async () => {
await installDeps(dir, ['ref']);
await forge.package({ dir });

0 comments on commit 435e83d

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