diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 2d52b62..ccfcd5d 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -339,6 +339,10 @@ fn restart_grasscutter(window: tauri::Window) -> bool { } } +#[cfg(unix)] +#[tauri::command] +fn restart_grasscutter(window: tauri::Window) {} + #[cfg(windows)] #[tauri::command] fn enable_grasscutter_watcher(window: tauri::Window, process: String) { @@ -400,6 +404,12 @@ fn enable_grasscutter_watcher(window: tauri::Window, process: String) { }); } +#[cfg(unix)] +#[tauri::command] +fn enable_grasscutter_watcher(window: tauri::Window, process: String) { + let gc_pid = Pid::from(696969); +} + #[tauri::command] async fn connect(port: u16, certificate_path: String) { // Log message to console. diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index c3537f1..c1a65a0 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -1,12 +1,14 @@ use duct::cmd; use ini::Ini; use std::path::PathBuf; +use std::ffi::OsStr; #[cfg(windows)] -use std::ffi::OsStr; -use registry::{Data, Hive, Security}; -use windows_service::service::{ServiceAccess, ServiceState::Stopped}; -use windows_service::service_manager::{ServiceManager, ServiceManagerAccess}; +use { + registry::{Data, Hive, Security}, + windows_service::service::{ServiceAccess, ServiceState::Stopped}, + windows_service::service_manager::{ServiceManager, ServiceManagerAccess}, +}; #[tauri::command] pub fn run_program(path: String, args: Option) { @@ -264,7 +266,9 @@ pub fn start_service(service: String) -> bool { #[cfg(unix)] #[tauri::command] -pub fn start_service(service: String) -> bool {} +pub fn start_service(service: String) { + let started = OsStr::new("Started service!"); +} #[cfg(windows)] #[tauri::command] @@ -287,7 +291,7 @@ pub fn stop_service(service: String) -> bool { #[cfg(unix)] #[tauri::command] -pub fn stop_service(service: String) -> bool {} +pub fn stop_service(service: String) {} #[cfg(unix)] #[tauri::command]