Skip to content

Commit

Permalink
fix(packager): fix ora sequencing when running with --arch=all
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Dec 11, 2016
1 parent 3d4ee59 commit e4dfded
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/electron-forge-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import rebuildHook from './util/rebuild';
import resolveDir from './util/resolve-dir';

const main = async () => {
const prepareSpinner = ora.ora('Preparing to Package Application').start();
let dir = process.cwd();

program
Expand All @@ -35,6 +34,11 @@ const main = async () => {
})
.parse(process.argv);

const arch = program.arch || process.arch;
const platform = program.platform || process.platform;

let prepareSpinner = ora.ora(`Preparing to Package Application for arch: ${(arch === 'all' ? 'ia32' : arch).cyan}`).start();

dir = await resolveDir(dir);
if (!dir) {
prepareSpinner.fail();
Expand All @@ -45,17 +49,20 @@ const main = async () => {

const packageJSON = JSON.parse(await fs.readFile(path.resolve(dir, 'package.json'), 'utf8'));

const arch = program.arch || process.arch;
const platform = program.platform || process.platform;

const forgeConfig = await getForgeConfig(dir);
let packagerSpinner;

// const targetCallCount = arch === 'all' ? (platform === 'darwin' ? 1 : 2) : 1; // eslint-disable-line

const packageOpts = Object.assign({
asar: false,
overwrite: true,
}, forgeConfig.electronPackagerConfig, {
afterCopy: [async (buildPath, electronVersion, pPlatform, pArch, done) => {
if (packagerSpinner) {
packagerSpinner.succeed();
prepareSpinner = ora.ora(`Preparing to Package Application for arch: ${'x64'.cyan}`).start();
}
await pify(rimraf)(path.resolve(buildPath, 'node_modules/electron-compile/test'));
done();
}, async (...args) => {
Expand Down
2 changes: 1 addition & 1 deletion src/makers/generic/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const zipPromise = (from, to) =>
});

export default async (dir, appName, targetArch, forgeConfig, packageJSON) => { // eslint-disable-line
const zipPath = path.resolve(dir, '../make', `${path.basename(dir)}_${targetArch}.zip`);
const zipPath = path.resolve(dir, '../make', `${path.basename(dir)}.zip`);
await ensureFile(zipPath);
switch (process.platform) {
case 'win32':
Expand Down

0 comments on commit e4dfded

Please sign in to comment.