Skip to content

Commit

Permalink
Fix mas build
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtkowiak committed Dec 21, 2018
1 parent 3e4f21b commit 8642750
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/defaultDependencies.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
electron: '2.0.10',
'electron-builder': '20.28.4',
'electron-packager': '12.1.2'
electron: '3.0.13',
'electron-builder': '20.38.4',
'electron-packager': '12.2.0'
};

15 changes: 14 additions & 1 deletion lib/electronBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class InstallerBuilder {
this.lastRebuild = {};
this.currentContext = null;
this.installerDir = path.join(this.$.env.options.output, this.$.env.paths.installerDir);
this.platforms = [];
}

async init() {
Expand All @@ -66,7 +67,8 @@ export default class InstallerBuilder {
* @returns {Object}
*/
prepareLastRebuildObject(arch, platform = process.platform) {
const productionDeps = this.packageDependencies.createLazyProductionDeps(this.$.env.paths.electronApp.root);
const productionDeps = this.packageDependencies
.createLazyProductionDeps(this.$.env.paths.electronApp.root);
this.lastRebuild = {
frameworkInfo: { version: this.$.getElectronVersion(), useCustomDist: true },
platform,
Expand Down Expand Up @@ -142,6 +144,11 @@ export default class InstallerBuilder {
* @returns {Promise}
*/
afterPack(context) {
this.platforms = this.platforms
.filter(platform => platform !== context.electronPlatformName);
if (this.platforms.length !== 0) {
return Promise.resovle();
}
return new Promise((resolve, reject) => {
shell.config.fatal = true;

Expand Down Expand Up @@ -329,6 +336,12 @@ export default class InstallerBuilder {
output: path.join(this.$.env.options.output, this.$.env.paths.installerDir)
};

if ('mac' in builderOptions && 'target' in builderOptions.mac) {
if (builderOptions.mac.target.includes('mas')) {
this.platforms = ['darwin', 'mas'];
}
}

try {
this.log.debug('calling build from electron-builder');
await this.builder.dependency.build(Object.assign({
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class MeteorDesktop {
const { dependencies = {}, devDependencies = {} } = JSON.parse(
fs.readFileSync(path.join(this.env.paths.meteorApp.root, 'package.json'), 'UTF-8')
);
if (!( name in dependencies ) && !( name in devDependencies )) {
if (!(name in dependencies) && !(name in devDependencies)) {
await this.meteorApp.runNpm(['i', '-D', '-E', '--only=dev', `${name}@${version}`], 'inherit');
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meteor-desktop",
"version": "2.0.0",
"version": "2.0.1",
"bin": {
"meteor-desktop": "dist/bin/cli.js"
},
Expand Down

0 comments on commit 8642750

Please sign in to comment.