mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
23 lines
564 B
Rust
23 lines
564 B
Rust
#![cfg_attr(
|
|
all(not(debug_assertions), target_os = "windows"),
|
|
windows_subsystem = "windows"
|
|
)]
|
|
|
|
use tauri::{Manager};
|
|
|
|
#[derive(Clone, serde::Serialize)]
|
|
struct Payload {
|
|
args: Vec<String>,
|
|
cwd: String,
|
|
}
|
|
|
|
fn main() {
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_single_instance::init(|app, argv, cwd| {
|
|
println!("{}, {argv:?}, {cwd}", app.package_info().name);
|
|
app.emit_all("single-instance", Payload { args: argv, cwd }).unwrap();
|
|
}))
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|