Skip to content

Commit

Permalink
release-app fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Feb 20, 2025
1 parent f457fb1 commit ed6b682
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.35.10"
version = "0.35.11"
description = ""
authors = ["you"]
license = ""
Expand Down
74 changes: 37 additions & 37 deletions screenpipe-app-tauri/src-tauri/src/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,43 +93,47 @@ pub async fn stop_screenpipe(
}
}

// Hard kill the sidecar
let kill_result = async {
#[cfg(not(target_os = "windows"))]
{
tokio::process::Command::new("pkill")
.arg("-f")
.arg("screenpipe")
.output()
.await
}
#[cfg(target_os = "windows")]
#[cfg(not(target_os = "windows"))]
{
match tokio::process::Command::new("pkill")
.arg("-f")
.arg("screenpipe")
.output()
.await
{
const CREATE_NO_WINDOW: u32 = 0x08000000;
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
let _ = tokio::process::Command::new("powershell")
.arg("-NoProfile")
.arg("-WindowStyle")
.arg("hidden")
.arg("-Command")
.arg(format!(
r#"taskkill.exe /F /T /IM screenpipe.exe"#,
))
.creation_flags(CREATE_NO_WINDOW)
.output()
.await;
Ok(_) => {
debug!("Successfully killed screenpipe processes");
Ok(())
}
Err(e) => {
error!("Failed to kill screenpipe processes: {}", e);
Err(format!("Failed to kill screenpipe processes: {}", e))
}
}
}
.await;

match kill_result {
Ok(_) => {
debug!("Successfully killed screenpipe processes");
Ok(())
}
Err(e) => {
error!("Failed to kill screenpipe processes: {}", e);
Err(format!("Failed to kill screenpipe processes: {}", e))
#[cfg(target_os = "windows")]
{
const CREATE_NO_WINDOW: u32 = 0x08000000;
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
match tokio::process::Command::new("powershell")
.arg("-NoProfile")
.arg("-WindowStyle")
.arg("hidden")
.arg("-Command")
.arg(r#"taskkill.exe /F /T /IM screenpipe.exe"#)
.creation_flags(CREATE_NO_WINDOW)
.output()
.await
{
Ok(_) => {
debug!("Successfully killed screenpipe processes");
Ok(())
}
Err(e) => {
error!("Failed to kill screenpipe processes: {}", e);
Err(format!("Failed to kill screenpipe processes: {}", e))
}
}
}
}
Expand Down Expand Up @@ -512,16 +516,13 @@ impl SidecarManager {
}
}



pub async fn spawn(&mut self, app: &tauri::AppHandle) -> Result<(), String> {
// Update settings from store
self.update_settings(app).await?;

// Spawn the sidecar
let child = spawn_sidecar(app)?;
self.child = Some(child);


Ok(())
}
Expand All @@ -540,5 +541,4 @@ impl SidecarManager {

Ok(())
}

}

0 comments on commit ed6b682

Please sign in to comment.