Skip to content

Commit

Permalink
fix: make watcher's path absolute for notify's MacOS fsevent implemen…
Browse files Browse the repository at this point in the history
…tation (rapiz1#155)
  • Loading branch information
voidbuf authored Apr 15, 2022
1 parent 8a24723 commit 8665e6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/config_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
use anyhow::{Context, Result};
use std::{
collections::HashMap,
env,
path::{Path, PathBuf},
};
use tokio::sync::{broadcast, mpsc};
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 8665e6a

Please sign in to comment.