desktopToDarwinBundle: Implement %f and %u Exec field codes
`%f` and `%u` are used to signal the program only accepts a single file or URI argument. I do not believe there's a way to signal this information to macOS but it is possible the program really won't work if multiple files are passed and it's possible the relative position of `%i`, `%c` or `%k` matters. So we replace `%f` or `%u` with `$1`. That way we only pass one file in the (possibly significant) position of the field code.
This commit is contained in:
parent
196f989ae8
commit
f31d945755
1 changed files with 2 additions and 1 deletions
|
@ -178,7 +178,8 @@ processExecFieldCodes() {
|
|||
local -r execNoKC="${execNoK/\%c/$(getDesktopParam "${file}" "Name")}"
|
||||
local -r icon=$(getDesktopParam "${file}" "Icon")
|
||||
local -r execNoKCI="${execNoKC/\%i/${icon:+--icon }${icon}}"
|
||||
local -r exec="${execNoKCI// %[fFuU]}"
|
||||
local -r execNoKCIfu="${execNoKCI/\%[fu]/\$1}"
|
||||
local -r exec="${execNoKCIfu// %[FU]}"
|
||||
if [[ "$exec" != "$execRaw" ]]; then
|
||||
echo 1>&2 "desktopToDarwinBundle: Application bundles do not understand desktop entry field codes. Changed '$execRaw' to '$exec'."
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue