Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/cmd/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ where
let _ = watcher.watch(&book.root.join("book.toml"), NonRecursive);

for dir in &book.config.build.extra_watch_dirs {
let path = dir.canonicalize().unwrap();
if let Err(e) = watcher.watch(&path, Recursive) {
let path = book.root.join(dir);
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 while watching extra directory {:?}:\n {:?}",
path, e
canonical_path, e
);
std::process::exit(1);
}
Expand Down