refactor(launcher): canonicalize default profiles

This commit is contained in:
Scott Idem
2026-05-13 12:15:13 -04:00
parent c79ae92be0
commit 1374f0728e
5 changed files with 210 additions and 286 deletions

View File

@@ -65,7 +65,7 @@ export async function launch_from_cache({
temp_root,
filename,
hash_prefix_length = 2,
script_template = null
native_template = null
}: {
cache_root: string;
hash: string;
@@ -73,17 +73,17 @@ export async function launch_from_cache({
filename: string;
hash_prefix_length?: number;
/**
* Optional data-driven launch script. If provided, Electron runs this instead of
* its hardcoded extension-based logic — no app rebuild needed for script changes.
* Resolved native launch template. If provided, Electron executes this string
* after the file is copied to temp.
*
* Two formats:
* - AppleScript: multi-line string with {{path}} placeholder (macOS only)
* - Shell command: prefix with "shell:" → e.g. "shell:open \"{{path}}\""
*
* Configure via event_device.data_json.launch_profiles or $events_loc.launcher.launch_profiles.
* If null, Electron falls through to its built-in hardcoded defaults.
* If null, Electron should treat that as a missing profile error.
*/
script_template?: string | null;
native_template?: string | null;
}) {
if (!native)
return { success: false, error: 'Native bridge not available' };
@@ -93,7 +93,7 @@ export async function launch_from_cache({
temp_root,
filename,
hash_prefix_length,
script_template
native_template
});
}