Support linux binaries with spaces in the name

This commit is contained in:
Caelan Sayler
2024-03-17 17:57:54 +00:00
parent 23d27db4b5
commit 2ba40213c2
3 changed files with 5 additions and 1 deletions

0
samples/AvaloniaCrossPlat/dev-scripts/build-linux.sh Normal file → Executable file
View File

View File

@@ -30,7 +30,7 @@ public class LinuxPackCommandRunner : PackageBuilder<LinuxPackOptions>
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}"/usr/bin/:"${PATH}"
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1 | sed 's/\\s/ /g')
exec "${EXEC}" $@
""");
Chmod.ChmodFileAsExecutable(appRunPath);
@@ -40,6 +40,10 @@ exec "${EXEC}" $@
if (!File.Exists(mainExePath))
throw new Exception($"Could not find main executable at '{mainExePath}'. Please specify with --exeName.");
// spaces should be represented by \s
// https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html
mainExeName = mainExeName.Replace(" ", "\\s");
File.WriteAllText(Path.Combine(dir.FullName, Options.PackId + ".desktop"), $"""
[Desktop Entry]
Type=Application

0
vendor/appimagetool-x86_64.AppImage vendored Normal file → Executable file
View File