Watch root directory instead of current one

This commit is contained in:
Laurenz 2023-03-28 14:54:39 +02:00
parent 6fa33fda6e
commit 628e589bcd

View File

@ -214,9 +214,9 @@ fn compile(command: CompileCommand) -> StrResult<()> {
let mut watcher = RecommendedWatcher::new(tx, notify::Config::default()) let mut watcher = RecommendedWatcher::new(tx, notify::Config::default())
.map_err(|_| "failed to watch directory")?; .map_err(|_| "failed to watch directory")?;
// Watch this directory recursively. // Watch root directory recursively.
watcher watcher
.watch(Path::new("."), RecursiveMode::Recursive) .watch(&world.root, RecursiveMode::Recursive)
.map_err(|_| "failed to watch directory")?; .map_err(|_| "failed to watch directory")?;
// Handle events. // Handle events.