refactor(desktop): tighten autoLaunch helpers per code review

This commit is contained in:
Jannis Braun
2026-04-27 12:38:33 +02:00
parent 191ba5f248
commit 495cad717d
2 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -18,12 +18,13 @@ export function parseExecPathFromDesktopFile(content: string): string | null {
const line = raw.trim();
if (!line || line.startsWith('#')) continue;
if (!line.startsWith('Exec=')) continue;
const value = line.slice('Exec='.length).trimStart();
const value = line.slice('Exec='.length);
if (!value) continue;
if (value.startsWith('"')) {
const end = value.indexOf('"', 1);
if (end === -1) return null;
return value.slice(1, end);
const extracted = value.slice(1, end);
return extracted === '' ? null : extracted;
}
const sp = value.indexOf(' ');
return sp === -1 ? value : value.slice(0, sp);