From 6b0e68d89d8e6ff1f66bba8985ac335f18fb4013 Mon Sep 17 00:00:00 2001 From: Abdul Wahab Date: Fri, 11 Sep 2026 02:57:19 +0500 Subject: [PATCH] bake: report the stylesheet path in posix form The accept's `css.file` is a path the agent reads back, so it is normalised like the wrap step's files; the stylesheet-search test compares posix paths too. Both showed up on the Windows job as backslashes. Written with AI assistance (Claude). Co-Authored-By: Claude Fable 5 --- crates/live/src/bake.rs | 4 ++-- crates/live/src/live_accept.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/live/src/bake.rs b/crates/live/src/bake.rs index 3f1cd6818..094a2c72f 100644 --- a/crates/live/src/bake.rs +++ b/crates/live/src/bake.rs @@ -533,12 +533,12 @@ mod tests { std::fs::write(dir.join("src/styles.css"), ".pricing-grid { display: grid }\n.pricing-card { padding: 1px }").unwrap(); std::fs::write(dir.join("node_modules/x/x.css"), ".pricing-grid { color: red }").unwrap(); let cwd = dir.to_string_lossy().into_owned(); - let found = find_owning_stylesheet(&cwd, "div.pricing-grid").unwrap(); + let found = jsp::to_posix(&find_owning_stylesheet(&cwd, "div.pricing-grid").unwrap()); assert!(found.ends_with("src/styles.css"), "{found}"); assert_eq!(find_owning_stylesheet(&cwd, "div.nothing-here"), None); std::fs::remove_file(dir.join("src/styles.css")).unwrap(); // One stylesheet in the app: it is the one. - let only = find_owning_stylesheet(&cwd, "div.nothing-here").unwrap(); + let only = jsp::to_posix(&find_owning_stylesheet(&cwd, "div.nothing-here").unwrap()); assert!(only.ends_with("src/reset.css"), "{only}"); let _ = std::fs::remove_dir_all(&dir); } diff --git a/crates/live/src/live_accept.rs b/crates/live/src/live_accept.rs index c4b8431b7..62b595da6 100644 --- a/crates/live/src/live_accept.rs +++ b/crates/live/src/live_accept.rs @@ -489,7 +489,7 @@ fn accept_cli(args: &[String], io: &mut Io) -> i32 { m.insert( "css".into(), json!({ - "file": css_file.as_deref().map(|f| jsp::relative("/", &cwd, f)), + "file": css_file.as_deref().map(|f| jsp::to_posix(&jsp::relative("/", &cwd, f))), "rules": rules, "anchor": anchor, }),