Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): avoid temporary icon copies on Linux launches #19589

Mergedonly21mil(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/19589/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 97 additions and 29 deletions (loading 2).

x
0 of 4 viewed, 4 left
91 additions and 27 deletionsapps/desktop/src/app/DesktopLinuxUrlHandler.test.tsModified
View file
@@ -22,8 +22,31 @@
readonly files: Array<{ readonly path: string; readonly content: string }>;
readonly commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }>;
readonly copies: Array<{ readonly source: string; readonly destination: string }>;
+ readonly binaryReads: string[];
+ readonly binaryWrites: Array<{
+ readonly path: string;
+ readonly bytes: Uint8Array;
+ readonly mode: number | undefined;
+ }>;
​
+const iconSource = "/tmp/.mount_T3/resources/app.asar/apps/desktop/prod-resources/icon.png";
+const iconPath = "/home/alice/.local/share/icons/com.t3tools.T3Code.desktop.png";
+const iconBytes = new Uint8Array([0x89, 0x50, 0x00, 0xff, 0x80, 0x0a]);
+const currentDesktopEntry = DesktopLinuxUrlHandler.renderUrlHandlerDesktopEntry({
+ displayName: "T3 Code (Alpha)",
+ execTarget: "/home/alice/Applications/T3-Code.AppImage",
+ scheme: "t3code",
+ iconPath,
+});
+const registrationCommands = [
+ { command: "update-desktop-database", args: ["/home/alice/.local/share/applications"] },
+ {
+ command: "xdg-mime",
+ args: ["default", "com.t3tools.T3Code.desktop", "x-scheme-handler/t3code"],
+ },
+];
+​
const makeEnvironment = (path: Path.Path, overrides: Record<string, unknown> = {}) =>