diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-08-10 11:02:49 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-08-10 18:44:15 +0200 |
| commit | 212f5f13387589e5b29292dc6d833c191749d299 (patch) | |
| tree | e7f59350dc16336368d74235893fe7fbad81e841 /gui/tasks | |
| parent | 0b33e493f0a0c73ca74bd85ccc56bca94436839c (diff) | |
| download | mullvadvpn-212f5f13387589e5b29292dc6d833c191749d299.tar.xz mullvadvpn-212f5f13387589e5b29292dc6d833c191749d299.zip | |
Fix universal build after last npm audit fix
Diffstat (limited to 'gui/tasks')
| -rw-r--r-- | gui/tasks/distribution.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gui/tasks/distribution.js b/gui/tasks/distribution.js index 87a07d3c96..cee853748a 100644 --- a/gui/tasks/distribution.js +++ b/gui/tasks/distribution.js @@ -1,6 +1,7 @@ const path = require('path'); const fs = require('fs'); const builder = require('electron-builder'); +const { Arch } = require('electron-builder'); const parseSemver = require('semver/functions/parse'); const { notarize } = require('electron-notarize'); const { version } = require('../package.json'); @@ -49,14 +50,16 @@ const config = { // Make sure that all files declared in "extraResources" exists and abort if they don't. afterPack: (context) => { - const resources = context.packager.platformSpecificBuildOptions.extraResources; - for (const resource of resources) { - const filePath = resource.from.replace(/\$\{env\.(.*)\}/, function (match, captureGroup) { - return process.env[captureGroup]; - }); + if (context.arch !== Arch.universal) { + const resources = context.packager.platformSpecificBuildOptions.extraResources; + for (const resource of resources) { + const filePath = resource.from.replace(/\$\{env\.(.*)\}/, function (match, captureGroup) { + return process.env[captureGroup]; + }); - if (!fs.existsSync(filePath)) { - throw new Error(`Can't find file: ${filePath}`); + if (!fs.existsSync(filePath)) { + throw new Error(`Can't find file: ${filePath}`); + } } } }, @@ -248,8 +251,11 @@ function packMac() { afterPack: (context) => { config.afterPack?.(context); - delete process.env.TARGET_TRIPLE; - appOutDirs.push(context.appOutDir); + if (context.arch !== Arch.universal) { + delete process.env.TARGET_TRIPLE; + appOutDirs.push(context.appOutDir); + } + return Promise.resolve(); }, afterAllArtifactBuild: async (buildResult) => { |
