From cb96aa06277f7b864952827ec9fb1e74c8a1f761 Mon Sep 17 00:00:00 2001 From: i-c-b <133848861+i-c-b@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:01:49 +1000 Subject: [PATCH] fix(fs): rename `dir` field to `base_dir` in `WatchOptions`, fixes #1081 (#1082) * fix(fs): rename `dir` field to `base_dir` in `WatchOptions`, fixes #1081 * Create fix-fs-watcher-basedir.md --- .changes/fix-fs-watcher-basedir.md | 5 +++++ plugins/fs/src/watcher.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/fix-fs-watcher-basedir.md diff --git a/.changes/fix-fs-watcher-basedir.md b/.changes/fix-fs-watcher-basedir.md new file mode 100644 index 00000000..031056b7 --- /dev/null +++ b/.changes/fix-fs-watcher-basedir.md @@ -0,0 +1,5 @@ +--- +"fs": patch +--- + +Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter. diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index d83262a2..0795aa49 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -75,7 +75,7 @@ fn watch_debounced(on_event: Channel, rx: Receiver) { #[derive(Deserialize)] #[serde(rename_all = "camelCase")] pub struct WatchOptions { - dir: Option, + base_dir: Option, recursive: bool, delay_ms: Option, } @@ -96,7 +96,7 @@ pub async fn watch( &global_scope, &command_scope, path, - options.dir, + options.base_dir, )?); }