Watch `tests/compile-test.rs` in `cargo dev serve`

This commit is contained in:
Alex Macleod 2024-10-30 19:21:25 +00:00
parent 5678531c6d
commit a7aa8bfde0
1 changed files with 7 additions and 1 deletions

View File

@ -20,8 +20,14 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
loop {
let index_time = mtime("util/gh-pages/index.html");
let times = [
"clippy_lints/src",
"util/gh-pages/index_template.html",
"tests/compile-test.rs",
]
.map(mtime);
if index_time < mtime("clippy_lints/src") || index_time < mtime("util/gh-pages/index_template.html") {
if times.iter().any(|&time| index_time < time) {
Command::new(env::var("CARGO").unwrap_or("cargo".into()))
.arg("collect-metadata")
.spawn()