Skip to content

Commit

Permalink
fix: only run watch_file hook when it has changed file (#3394)
Browse files Browse the repository at this point in the history
Fixes #3323
  • Loading branch information
jdx authored Dec 7, 2024
1 parent 45a2513 commit 3e5461d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/watch_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub fn execute_runs(ts: &Toolset) {
}
for (root, wf) in Config::get().watch_file_hooks().unwrap_or_default() {
match has_matching_files(&root, &wf, &files) {
Ok(files) if files.is_empty() => {
continue;
}
Ok(files) => {
if let Err(e) = execute(ts, &root, &wf.run, files) {
warn!("error executing watch_file hook: {e}");
Expand Down

0 comments on commit 3e5461d

Please sign in to comment.