Skip to content

Commit 87a620f

Browse files
committed
fix
1 parent d1367c8 commit 87a620f

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

src-tauri/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ futures = "0.3"
3737

3838
# Automation
3939
enigo = "0.6.1"
40+
which = "8"
4041

4142
# Context
4243
rayon = "1.10"
@@ -107,7 +108,7 @@ serde_rusqlite = "0.40"
107108
uuid = { version = "1.19", features = ["v4"] }
108109
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
109110
listeners = "0.3"
110-
which = "8.0"
111+
which = { workspace = true }
111112
wait-timeout = "0.2"
112113
csv = "1.4"
113114
walkdir = "2"

src-tauri/crates/automator/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ enigo = { workspace = true }
1414
xcap = "0.8"
1515
image = { workspace = true }
1616
thiserror = { workspace = true }
17+
which = { workspace = true }
1718

1819
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
1920
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-native-roots"] }

src-tauri/src/apps.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use ctxrun_db::{AppEntry, DbState};
22
use tauri::State;
3-
use std::path::{Path, PathBuf};
3+
use std::path::PathBuf;
4+
5+
#[cfg(any(target_os = "windows", target_os = "linux"))]
6+
use std::path::Path;
47

58
#[cfg(target_os = "windows")]
69
use walkdir::WalkDir;
@@ -30,15 +33,18 @@ pub async fn launch_browser(
3033
let exe_path = find_browser_executable(&browser_type)?;
3134

3235
// 构建启动命令
33-
let mut cmd = if cfg!(target_os = "windows") {
36+
#[cfg(target_os = "windows")]
37+
let mut cmd = {
38+
use std::os::windows::process::CommandExt;
3439
let mut c = std::process::Command::new(&exe_path);
3540
// DETACHED_PROCESS = 0x00000008,让进程独立运行
3641
c.creation_flags(0x00000008);
3742
c
38-
} else {
39-
std::process::Command::new(&exe_path)
4043
};
4144

45+
#[cfg(not(target_os = "windows"))]
46+
let mut cmd = std::process::Command::new(&exe_path);
47+
4248
// 添加调试端口参数
4349
cmd.arg("--remote-debugging-port=9222");
4450
cmd.arg("--no-first-run");

src-tauri/src/env_probe/browsers.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ use crate::env_probe::{common, ToolInfo};
33
use std::path::Path;
44
use rayon::prelude::*;
55

6-
#[cfg(target_os = "macos")]
7-
use std::process::Command;
8-
96

107
#[allow(dead_code)]
118
struct BrowserConfig {

0 commit comments

Comments
 (0)