Skip to content

Commit 5468c18

Browse files
authored
fix(linux): mutually exclusive exec command args (#6384)
* fix(linux): If linux `executableArgs` already contains one of the mutually exclusive(%f / %u / %F / %U) code,don't append `%U`. (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables)
1 parent 66ca625 commit 5468c18

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/afraid-lizards-juggle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix(linux): If linux executableArgs already contains one of the mutually exclusive(%f / %u / %F / %U) code,don't append %U.

packages/app-builder-lib/src/targets/LinuxTargetHelper.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ export class LinuxTargetHelper {
105105
exec += " "
106106
exec += executableArgs.join(" ")
107107
}
108-
exec += " %U"
108+
// https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
109+
const execCodes = ['%f', '%u', '%F', '%U']
110+
if (executableArgs == null || executableArgs.findIndex((arg) => execCodes.includes(arg)) === -1) {
111+
exec += " %U"
112+
}
109113
}
110114

111115
const desktopMeta: any = {

0 commit comments

Comments
 (0)