-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sandbox error on AppImage startup on certain linux systems (#4458)
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// from https://github.com/d3473r/jitsi-meet-electron/commit/11b9348f117a87349917c252cbae203cf92062a | ||
// | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters