Skip to content

Commit

Permalink
Fix #165, context does not always have appOut property
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtkowiak committed Apr 30, 2018
1 parent c1ad0a9 commit 3af853a
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 92 deletions.
11 changes: 6 additions & 5 deletions lib/electronBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class InstallerBuilder {
this.firstPass = true;
this.lastRebuild = {};
this.currentContext = null;
this.installerDir = path.join(this.$.env.options.output, this.$.env.paths.installerDir);
}

/**
Expand Down Expand Up @@ -131,7 +132,7 @@ export default class InstallerBuilder {
* Callback to be invoked after packing. Restores node_modules to the .desktop-build.
* @returns {Promise}
*/
afterPack(context) {
afterPack() {
return new Promise((resolve, reject) => {
shell.config.fatal = true;

Expand All @@ -140,7 +141,7 @@ export default class InstallerBuilder {
shell.cp(
'-Rf',
this.$.env.paths.electronApp.extractedNodeModules,
path.join(this.getPackagedAppPath(context), 'node_modules')
path.join(this.getPackagedAppPath(), 'node_modules')
);
}

Expand Down Expand Up @@ -207,18 +208,18 @@ export default class InstallerBuilder {
* Returns the path to packaged app.
* @returns {string}
*/
getPackagedAppPath(context = {}) {
getPackagedAppPath() {
if (this.currentContext.platform.nodeName === 'darwin') {
return path.join(
context.appOutDir,
this.installerDir,
`${context.packager.appInfo.productFilename}.app`,
'Contents', 'Resources', 'app'
);
}
const platformDir =
`${this.currentContext.platform.nodeName === 'win32' ? 'win' : 'linux'}-${this.currentContext.arch === 'ia32' ? 'ia32-' : ''}unpacked`;
return path.join(
context.appOutDir,
this.installerDir,
platformDir,
'resources', 'app'
);
Expand Down
173 changes: 86 additions & 87 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3af853a

Please sign in to comment.