From 77d75f024f86c2d9694aeffcb04c6aeba11a35cb Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:33:28 -0600 Subject: [PATCH] fix: skip optional env._.file files (#3381) Fixes #1777 --- src/hook_env.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hook_env.rs b/src/hook_env.rs index c4ef9f9962..78cbec5628 100644 --- a/src/hook_env.rs +++ b/src/hook_env.rs @@ -129,7 +129,9 @@ pub fn build_watches( ) -> Result { let mut max_modtime = UNIX_EPOCH; for cf in get_watch_files(watch_files) { - max_modtime = std::cmp::max(cf.metadata()?.modified()?, max_modtime); + if let Ok(Ok(modified)) = cf.metadata().map(|m| m.modified()) { + max_modtime = std::cmp::max(modified, max_modtime); + } } Ok(HookEnvWatches {