mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-14 10:26:19 +01:00
b07d7ee1c6
* Add wrapper script to protect from coredumps and re-enable process reload * Allow args passthrough and clean up after-pack script
27 lines
959 B
JavaScript
27 lines
959 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires, no-console */
|
|
require("dotenv").config();
|
|
const path = require("path");
|
|
|
|
const fse = require("fs-extra");
|
|
|
|
exports.default = run;
|
|
|
|
async function run(context) {
|
|
console.log("## After pack");
|
|
console.log(context);
|
|
if (context.electronPlatformName === "linux") {
|
|
console.log("Creating memory-protection wrapper script");
|
|
const appOutDir = context.appOutDir;
|
|
const oldBin = path.join(appOutDir, context.packager.executableName);
|
|
const newBin = path.join(appOutDir, "bitwarden-app");
|
|
fse.moveSync(oldBin, newBin);
|
|
console.log("Moved binary to bitwarden-app");
|
|
|
|
const wrapperScript = path.join(__dirname, "../resources/memory-dump-wrapper.sh");
|
|
const wrapperBin = path.join(appOutDir, context.packager.executableName);
|
|
fse.copyFileSync(wrapperScript, wrapperBin);
|
|
fse.chmodSync(wrapperBin, "755");
|
|
console.log("Copied memory-protection wrapper script");
|
|
}
|
|
}
|