Skip to content

Commit

Permalink
Watch tests/compile-test.rs in cargo dev serve
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Oct 30, 2024
1 parent 5678531 commit a7aa8bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clippy_dev/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a7aa8bf

Please sign in to comment.