Skip to content

Commit

Permalink
Fix electron-userland#4587 executableArgs option ignored for snap tar…
Browse files Browse the repository at this point in the history
…get bug
  • Loading branch information
fangpenlin committed Oct 20, 2022
1 parent 5616f23 commit 8ef0f19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,19 @@ export default class SnapTarget extends Target {
Icon: "${SNAP}/meta/gui/icon.png",
})

const extraAppArgs: Array<string> = options.executableArgs ?? []
if (this.isElectronVersionGreaterOrEqualThan("5.0.0") && !isBrowserSandboxAllowed(snap)) {
args.push("--extraAppArgs=--no-sandbox")
const noSandboxArg = "--no-sandbox"
if (!extraAppArgs.includes(noSandboxArg)) {
extraAppArgs.push(noSandboxArg)
}
if (this.isUseTemplateApp) {
args.push("--exclude", "chrome-sandbox")
}
}
if (extraAppArgs.length > 0) {
args.push("--extraAppArgs=" + extraAppArgs.join(" "))
}

if (snap.compression != null) {
args.push("--compression", snap.compression)
Expand Down

0 comments on commit 8ef0f19

Please sign in to comment.