Skip to content

Commit 37d0cab

Browse files
gschierclaude
andauthored
fix: preserve drive letter in Windows plugin paths (#410)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 435ee54 commit 37d0cab

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ flatpak/node-sources.json
5454

5555
# Local Codex desktop env state
5656
.codex/environments/environment.toml
57+
58+
# Claude Code local settings
59+
.claude/settings.local.json

Cargo.lock

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

crates/yaak-plugins/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ log = { workspace = true }
1515
md5 = "0.7.0"
1616
path-slash = "0.2.1"
1717
rand = "0.9.0"
18-
regex = "1.10.6"
1918
reqwest = { workspace = true, features = ["json"] }
2019
serde = { workspace = true, features = ["derive"] }
2120
serde_json = { workspace = true }

crates/yaak-plugins/src/manager.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,16 +1081,10 @@ async fn read_plugins_dir(dir: &PathBuf) -> Result<Vec<String>> {
10811081
fn fix_windows_paths(p: &PathBuf) -> String {
10821082
use dunce;
10831083
use path_slash::PathBufExt;
1084-
use regex::Regex;
10851084

1086-
// 1. Remove UNC prefix for Windows paths to pass to sidecar
1087-
let safe_path = dunce::simplified(p.as_path()).to_string_lossy().to_string();
1085+
// 1. Remove UNC prefix for Windows paths
1086+
let safe_path = dunce::simplified(p.as_path());
10881087

1089-
// 2. Remove the drive letter
1090-
let safe_path = Regex::new("^[a-zA-Z]:").unwrap().replace(safe_path.as_str(), "");
1091-
1092-
// 3. Convert backslashes to forward
1093-
let safe_path = PathBuf::from(safe_path.to_string()).to_slash_lossy().to_string();
1094-
1095-
safe_path
1088+
// 2. Convert backslashes to forward slashes for Node.js compatibility
1089+
PathBuf::from(safe_path).to_slash_lossy().to_string()
10961090
}

scripts/run-dev.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const args = [
4545
...additionalArgs
4646
];
4747

48-
const result = spawnSync('tauri', args, { stdio: 'inherit', shell: false, env: process.env });
48+
// Invoke the tauri CLI JS entry point directly via node to avoid shell escaping issues on Windows
49+
const tauriJs = path.join(rootDir, 'node_modules', '@tauri-apps', 'cli', 'tauri.js');
50+
51+
const result = spawnSync(process.execPath, [tauriJs, ...args], { stdio: 'inherit', env: process.env });
4952

5053
process.exit(result.status || 0);

0 commit comments

Comments
 (0)