diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-01-11 10:23:08 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-01-11 17:31:05 +0100 |
| commit | a1f95677ae474c0db0d3dd51954eba557d3202d7 (patch) | |
| tree | 554e5598d840c3c2397c235e6e2b4e8dd4991e1a | |
| parent | d10daa2d213aa510a5e87bbd3ee47794149e00b9 (diff) | |
| download | mullvadvpn-a1f95677ae474c0db0d3dd51954eba557d3202d7.tar.xz mullvadvpn-a1f95677ae474c0db0d3dd51954eba557d3202d7.zip | |
Ensure paths exists when packaging app
| -rw-r--r-- | gui/tasks/distribution.js | 17 |
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'); |
