Skip to content

Commit 3f139dd

Browse files
committed
fix(discovery): normalize path separators in build.rs for Windows compatibility
1 parent c751936 commit 3f139dd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/opencli-rs-discovery/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ fn main() {
2424

2525
let mut code = String::from("pub const BUILTIN_ADAPTERS: &[(&str, &str)] = &[\n");
2626
for (rel_path, abs_path) in &entries {
27+
// Normalize path separators to forward slash for cross-platform compatibility.
28+
// Windows uses backslash which Rust interprets as escape sequences in string literals.
2729
code.push_str(&format!(
2830
" (\"{}\", include_str!(\"{}\")),\n",
29-
rel_path,
31+
rel_path.replace('\\', "/"),
3032
abs_path.replace('\\', "/")
3133
));
3234
}

0 commit comments

Comments
 (0)