jotdown/tests/html-ref/build.rs
Noah Hellman 3cea79a122 mv suite{_bench} to test-html-{ut,ref} crates
- allow compiling/running html tests without compiling main crate tests
  (useful when e.g. making type changes to events but html unaffected)
- avoid need for future flags in main crate
2023-05-04 19:34:23 +02:00

17 lines
485 B
Rust

fn main() {
let has_dj = std::fs::read_dir(".").unwrap().any(|e| {
e.map_or(false, |e| {
e.path()
.extension()
.map_or(false, |ext| ext.to_str() == Some("dj"))
})
});
if has_dj {
let status = std::process::Command::new("make")
.status()
.expect("failed to execute make");
assert!(status.success());
} else {
std::fs::write("ref.rs", &[b'\n']).unwrap();
}
}