From 31f77355f18eb36d2720325a5c146892994b75cf Mon Sep 17 00:00:00 2001 From: Thoronium <107363768+NotThorny@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:08:52 -0600 Subject: [PATCH] Fix unix building --- src-tauri/src/main.rs | 8 +++++++- src-tauri/src/system_helpers.rs | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index ccfcd5d..3fb6aa8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -341,7 +341,13 @@ fn restart_grasscutter(window: tauri::Window) -> bool { #[cfg(unix)] #[tauri::command] -fn restart_grasscutter(window: tauri::Window) {} +fn restart_grasscutter(window: tauri::Window) { + // Placeholder text for imports + let s = System::new(); + if let Some(process) = s.process(Pid::from(1337)) { + println!("{}", process.name()); + } +} #[cfg(windows)] #[tauri::command] diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index c1a65a0..305856a 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -1,7 +1,7 @@ use duct::cmd; use ini::Ini; -use std::path::PathBuf; use std::ffi::OsStr; +use std::path::PathBuf; #[cfg(windows)] use { @@ -245,6 +245,10 @@ pub fn service_status(service: String) -> bool { } } +#[cfg(unix)] +#[tauri::command] +pub fn service_status(service: String) {} + #[cfg(windows)] #[tauri::command] pub fn start_service(service: String) -> bool {