From 84ef26ac9b5f0e1199d77837cd97cb203baa8729 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Sat, 7 Jan 2023 21:22:09 +0100 Subject: refactor(cli/tools): move flag and config logic to CliOptions (#17008) Co-authored-by: David Sherret --- cli/util/file_watcher.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cli/util/file_watcher.rs') diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs index 741cb5a04..b87782d6b 100644 --- a/cli/util/file_watcher.rs +++ b/cli/util/file_watcher.rs @@ -107,9 +107,13 @@ where log::debug!("File change ignored") } ResolutionResult::Restart { - paths_to_watch, + mut paths_to_watch, result, } => { + // watch the current directory when empty + if paths_to_watch.is_empty() { + paths_to_watch.push(PathBuf::from(".")); + } return (paths_to_watch, result); } } @@ -190,9 +194,13 @@ where print_after_restart(); } ResolutionResult::Restart { - paths_to_watch: paths, + paths_to_watch: mut paths, result, } => { + // watch the current directory when empty + if paths.is_empty() { + paths.push(PathBuf::from(".")); + } paths_to_watch = paths; resolution_result = result; } -- cgit v1.2.3