Merge pull request #2146 from riverbl/fix-extra-watch-dirs
Fix issues with extra-watch-dirs
This commit is contained in:
commit
4614a3637a
|
@ -130,11 +130,16 @@ where
|
||||||
let _ = watcher.watch(&book.root.join("book.toml"), NonRecursive);
|
let _ = watcher.watch(&book.root.join("book.toml"), NonRecursive);
|
||||||
|
|
||||||
for dir in &book.config.build.extra_watch_dirs {
|
for dir in &book.config.build.extra_watch_dirs {
|
||||||
let path = dir.canonicalize().unwrap();
|
let path = book.root.join(dir);
|
||||||
if let Err(e) = watcher.watch(&path, Recursive) {
|
let canonical_path = path.canonicalize().unwrap_or_else(|e| {
|
||||||
|
error!("Error while watching extra directory {path:?}:\n {e}");
|
||||||
|
std::process::exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
if let Err(e) = watcher.watch(&canonical_path, Recursive) {
|
||||||
error!(
|
error!(
|
||||||
"Error while watching extra directory {:?}:\n {:?}",
|
"Error while watching extra directory {:?}:\n {:?}",
|
||||||
path, e
|
canonical_path, e
|
||||||
);
|
);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue