1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-24 03:32:51 +02:00
bitwarden-browser/apps/desktop/scripts/after-pack.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
959 B
JavaScript
Raw Normal View History

/* 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");
}
}