SDA-4611 Disable EnableNodeCliInspectArguments electron fuse (#2196)

* SDA-4611 Disable EnableNodeCliInspectArguments electron fuse

* Semgrep update
This commit is contained in:
Salah Benmoussati
2024-09-06 09:34:13 +02:00
committed by GitHub
parent 9b77dabbfb
commit de0eb57dea
3 changed files with 25 additions and 1 deletions

21
scripts/afterPackHoock.js Normal file
View File

@@ -0,0 +1,21 @@
const path = require('path');
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
module.exports = async function afterPack(context) {
const {
appOutDir,
packager: { appInfo, platform },
} = context;
const ext = {
darwin: '.app',
win32: '.exe',
}[context.electronPlatformName];
const electronBinaryPath = path.join(
appOutDir,
`${appInfo.productFilename}${ext}`,
);
await flipFuses(electronBinaryPath, {
version: FuseVersion.V1,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
});
};