2021-03-22 16:52:12 +01:00
|
|
|
diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
|
2021-03-22 21:21:57 +01:00
|
|
|
index 41e067c..1aec3a6 100644
|
2021-03-22 16:52:12 +01:00
|
|
|
--- a/node_modules/app-builder-lib/out/macPackager.js
|
|
|
|
+++ b/node_modules/app-builder-lib/out/macPackager.js
|
2021-03-22 21:21:57 +01:00
|
|
|
@@ -292,6 +292,23 @@ class MacPackager extends _platformPackager().PlatformPackager {
|
2021-03-22 16:52:12 +01:00
|
|
|
|
|
|
|
const appFile = `${this.appInfo.productFilename}.app`;
|
|
|
|
|
|
|
|
+ // Bitwarden Patch: Electron-Builder currently does not support including our Safari extension which
|
|
|
|
+ // is already cross-compiled. Hence we remove it prior to making the universal package, and re-add
|
|
|
|
+ // it afterwards
|
|
|
|
+ // https://github.com/electron-userland/electron-builder/issues/5552
|
2021-03-22 21:21:57 +01:00
|
|
|
+ const rmdir = (0, _fsExtra().remove);
|
|
|
|
+ try {
|
|
|
|
+ await rmdir(`${x64AppOutDir}/Bitwarden.app/Contents/PlugIns`, {
|
|
|
|
+ recursive: true
|
|
|
|
+ });
|
|
|
|
+ await rmdir(`${arm64AppOutPath}/Bitwarden.app/Contents/PlugIns`, {
|
|
|
|
+ recursive: true
|
|
|
|
+ });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ // Catches errors where PlugIns does not exist
|
|
|
|
+ console.log(e);
|
|
|
|
+ }
|
2021-03-22 16:52:12 +01:00
|
|
|
+
|
|
|
|
const {
|
|
|
|
makeUniversalApp
|
|
|
|
} = require('@electron/universal');
|
2021-03-22 21:21:57 +01:00
|
|
|
@@ -302,7 +319,15 @@ class MacPackager extends _platformPackager().PlatformPackager {
|
2021-03-22 16:52:12 +01:00
|
|
|
outAppPath: path.join(appOutDir, appFile),
|
|
|
|
force: true
|
|
|
|
});
|
2021-03-22 21:21:57 +01:00
|
|
|
- const rmdir = (0, _util().promisify)(require('fs').rmdir);
|
2021-03-22 16:52:12 +01:00
|
|
|
+
|
|
|
|
+ // Bitwarden Patch: Re-add PlugIns dir to Universal binary
|
2021-03-22 21:21:57 +01:00
|
|
|
+ try {
|
|
|
|
+ await ((0, _fsExtra().copy)(path.join(this.projectDir, 'PlugIns'), `${path.join(appOutDir, appFile)}/Contents/PlugIns`));
|
|
|
|
+ } catch (e) {
|
|
|
|
+ // Catches errors where PlugIns does not exist
|
|
|
|
+ console.log(e);
|
|
|
|
+ }
|
2021-03-22 16:52:12 +01:00
|
|
|
+
|
|
|
|
await rmdir(x64AppOutDir, {
|
|
|
|
recursive: true
|
2021-03-22 21:21:57 +01:00
|
|
|
});
|