diff options
| author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-01-07 21:22:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-07 15:22:09 -0500 |
| commit | 84ef26ac9b5f0e1199d77837cd97cb203baa8729 (patch) | |
| tree | eb8f3422d397724d004dba0e9667b3f6c2b49a57 /cli/util/file_watcher.rs | |
| parent | fac64478157ee563b185edb5734688e4523df3a1 (diff) | |
refactor(cli/tools): move flag and config logic to CliOptions (#17008)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/util/file_watcher.rs')
| -rw-r--r-- | cli/util/file_watcher.rs | 12 |
1 files changed, 10 insertions, 2 deletions
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; } |
