summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-01-11 10:23:08 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-01-11 17:31:05 +0100
commita1f95677ae474c0db0d3dd51954eba557d3202d7 (patch)
tree554e5598d840c3c2397c235e6e2b4e8dd4991e1a
parentd10daa2d213aa510a5e87bbd3ee47794149e00b9 (diff)
downloadmullvadvpn-a1f95677ae474c0db0d3dd51954eba557d3202d7.tar.xz
mullvadvpn-a1f95677ae474c0db0d3dd51954eba557d3202d7.zip
Ensure paths exists when packaging app
-rw-r--r--gui/tasks/distribution.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/tasks/distribution.js b/gui/tasks/distribution.js
index 411970486d..1134351da4 100644
--- a/gui/tasks/distribution.js
+++ b/gui/tasks/distribution.js
@@ -46,6 +46,19 @@ const config = {
'!node_modules/@types',
],
+ // 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.TARGET_TRIPLE}', process.env.TARGET_TRIPLE);
+
+ if (!fs.existsSync(filePath)) {
+ throw new Error(`Can't find file: ${filePath}`);
+ }
+ }
+ },
+
mac: {
target: {
target: 'pkg',
@@ -227,6 +240,8 @@ function packMac() {
return true;
},
afterPack: (context) => {
+ config.afterPack?.(context);
+
delete process.env.TARGET_TRIPLE;
appOutDirs.push(context.appOutDir);
return Promise.resolve();
@@ -278,6 +293,8 @@ function packLinux() {
config: {
...config,
afterPack: async (context) => {
+ config.afterPack?.(context);
+
const sourceExecutable = path.join(context.appOutDir, 'mullvad-vpn');
const targetExecutable = path.join(context.appOutDir, 'mullvad-gui');
const launcherScript = path.join(context.appOutDir, 'mullvad-gui-launcher.sh');