jotdown/tests/html-ref/build.rs

18 lines
485 B
Rust
Raw Normal View History

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();
}
}