Skip to content

Commit

Permalink
feat: Extending linux executableArgs option to be utilized for Snap…
Browse files Browse the repository at this point in the history
… target (fixes #4587) (#7198)
  • Loading branch information
fangpenlin authored Oct 20, 2022
1 parent 5616f23 commit a2ce9a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/empty-ligers-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": major
---

Extending `linux` executableArgs option to be utilized for Snap target
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 a2ce9a7

Please sign in to comment.