fix: preserve drive letter in Windows plugin paths (#410)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-02-26 16:23:24 -08:00
committed by GitHub
parent 435ee54140
commit 37d0cabb22
5 changed files with 11 additions and 13 deletions

3
.gitignore vendored
View File

@@ -54,3 +54,6 @@ flatpak/node-sources.json
# Local Codex desktop env state # Local Codex desktop env state
.codex/environments/environment.toml .codex/environments/environment.toml
# Claude Code local settings
.claude/settings.local.json

1
Cargo.lock generated
View File

@@ -10359,7 +10359,6 @@ dependencies = [
"md5 0.7.0", "md5 0.7.0",
"path-slash", "path-slash",
"rand 0.9.1", "rand 0.9.1",
"regex 1.11.1",
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",

View File

@@ -15,7 +15,6 @@ log = { workspace = true }
md5 = "0.7.0" md5 = "0.7.0"
path-slash = "0.2.1" path-slash = "0.2.1"
rand = "0.9.0" rand = "0.9.0"
regex = "1.10.6"
reqwest = { workspace = true, features = ["json"] } reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true } serde_json = { workspace = true }

View File

@@ -1081,16 +1081,10 @@ async fn read_plugins_dir(dir: &PathBuf) -> Result<Vec<String>> {
fn fix_windows_paths(p: &PathBuf) -> String { fn fix_windows_paths(p: &PathBuf) -> String {
use dunce; use dunce;
use path_slash::PathBufExt; use path_slash::PathBufExt;
use regex::Regex;
// 1. Remove UNC prefix for Windows paths to pass to sidecar // 1. Remove UNC prefix for Windows paths
let safe_path = dunce::simplified(p.as_path()).to_string_lossy().to_string(); let safe_path = dunce::simplified(p.as_path());
// 2. Remove the drive letter // 2. Convert backslashes to forward slashes for Node.js compatibility
let safe_path = Regex::new("^[a-zA-Z]:").unwrap().replace(safe_path.as_str(), ""); PathBuf::from(safe_path).to_slash_lossy().to_string()
// 3. Convert backslashes to forward
let safe_path = PathBuf::from(safe_path.to_string()).to_slash_lossy().to_string();
safe_path
} }

View File

@@ -45,6 +45,9 @@ const args = [
...additionalArgs ...additionalArgs
]; ];
const result = spawnSync('tauri', args, { stdio: 'inherit', shell: false, env: process.env }); // Invoke the tauri CLI JS entry point directly via node to avoid shell escaping issues on Windows
const tauriJs = path.join(rootDir, 'node_modules', '@tauri-apps', 'cli', 'tauri.js');
const result = spawnSync(process.execPath, [tauriJs, ...args], { stdio: 'inherit', env: process.env });
process.exit(result.status || 0); process.exit(result.status || 0);