Skip to content

Commit

Permalink
fix(packager): package spinner isn't defined when asar.unpack is checked
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #396
  • Loading branch information
malept authored and MarshallOfSound committed Dec 24, 2017
1 parent 1a1884d commit 435e83d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/api/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
10 changes: 10 additions & 0 deletions test/slow/api_spec_slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 435e83d

Please sign in to comment.