diff options
Diffstat (limited to 'src/config_watcher.rs')
-rw-r--r-- | src/config_watcher.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config_watcher.rs b/src/config_watcher.rs index 00594c7..f80ac2c 100644 --- a/src/config_watcher.rs +++ b/src/config_watcher.rs @@ -5,6 +5,7 @@ use crate::{ use anyhow::{Context, Result}; use std::{ collections::HashMap, + env, path::{Path, PathBuf}, }; use tokio::sync::{broadcast, mpsc}; @@ -139,6 +140,11 @@ async fn config_watcher( mut old: Config, ) -> Result<()> { let (fevent_tx, mut fevent_rx) = mpsc::unbounded_channel(); + let path = if path.is_absolute() { + path + } else { + env::current_dir()?.join(path) + }; let parent_path = path.parent().expect("config file should have a parent dir"); let path_clone = path.clone(); let mut watcher = |