diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs index 605a80db..eacb1c7e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1454,12 +1454,16 @@ impl Monitor { let config_path = ::std::fs::canonicalize(path) .expect("canonicalize config path"); - watcher.watch(&config_path, RecursiveMode::NonRecursive).expect("watch alacritty yml"); + // Get directory of config + let mut parent = config_path.clone(); + parent.pop(); - loop { - let event = rx.recv().expect("watcher event"); + // Watch directory + watcher.watch(&parent, RecursiveMode::NonRecursive) + .expect("watch alacritty.yml dir"); - match event { + loop { + match rx.recv().expect("watcher event") { DebouncedEvent::Rename(_, _) => continue, DebouncedEvent::Write(path) | DebouncedEvent::Create(path) | DebouncedEvent::Chmod(path) => { |