From 3e5461d3b2847df317e955483775d8b14495c2e2 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Sat, 7 Dec 2024 07:26:35 -0600 Subject: [PATCH] fix: only run watch_file hook when it has changed file (#3394) Fixes #3323 --- src/watch_files.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/watch_files.rs b/src/watch_files.rs index ec388e0866..b966cabf66 100644 --- a/src/watch_files.rs +++ b/src/watch_files.rs @@ -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}");