mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
fix(autostart): Fix LaunchAgent macOS autostart (#1118)
* Fix LaunchAgent macOS autostart * Add .changes
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"autostart": patch
|
||||
---
|
||||
|
||||
Fix LaunchAgent-based autostart for macOS.
|
||||
@@ -129,11 +129,12 @@ pub fn init<R: Runtime>(
|
||||
// exe path to not break it.
|
||||
let exe_path = current_exe.canonicalize()?.display().to_string();
|
||||
let parts: Vec<&str> = exe_path.split(".app/").collect();
|
||||
let app_path = if parts.len() == 2 {
|
||||
format!("{}.app", parts.first().unwrap())
|
||||
} else {
|
||||
exe_path
|
||||
};
|
||||
let app_path =
|
||||
if parts.len() == 2 && matches!(macos_launcher, MacosLauncher::AppleScript) {
|
||||
format!("{}.app", parts.first().unwrap())
|
||||
} else {
|
||||
exe_path
|
||||
};
|
||||
info!("auto_start path {}", &app_path);
|
||||
builder.set_app_path(&app_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user