mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-05-02 16:54:52 +02:00
4cc851dc75
Modeled after https://github.com/electron-userland/electron-builder/issues/5371#issuecomment-791771150 but written with promised-based fs nodejs API. This allows to drop the app-builder-lib .desktop patch, as --no-sandbox is now part of all linux targets via the additional launcher script, so the arg can be dropped from the .desktop file Exec line. Manual workaround is removed from the README as well.
24 lines
749 B
JavaScript
24 lines
749 B
JavaScript
const fs = require('fs').promises;
|
|
const path = require('path');
|
|
|
|
/**
|
|
* Workaround for https://github.com/electron-userland/electron-builder/issues/5371
|
|
*
|
|
* use as "afterPack": "./linux-sandbox-fix.js" in build section of package.json
|
|
*/
|
|
async function afterPack({ appOutDir, electronPlatformName, packager }) {
|
|
if (electronPlatformName !== 'linux') {
|
|
return;
|
|
}
|
|
|
|
const appName = packager.appInfo.productFilename;
|
|
const script = `#!/bin/bash\n"\${BASH_SOURCE%/*}"/${appName}.bin --no-sandbox "$@"`;
|
|
const scriptPath = path.join(appOutDir, appName);
|
|
|
|
await fs.rename(scriptPath, `${scriptPath}.bin`);
|
|
await fs.writeFile(scriptPath, script);
|
|
await fs.chmod(scriptPath, 0o755);
|
|
}
|
|
|
|
module.exports = afterPack;
|