Make the error message more useful when no git root can be found

Fixes #4
main
Jan-Erik Rediger 2023-04-11 13:14:26 +02:00
parent 959d514c80
commit 9660612724
1 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,8 @@ impl Preprocessor for LastChanged {
fn run(&self, ctx: &PreprocessorContext, mut book: Book) -> Result<Book> {
let book_root = &ctx.root;
let src_root = book_root.join(&ctx.config.book.src);
let git_root = find_git(book_root).unwrap();
let git_root = find_git(book_root)
.expect("Couldn't find the root of this project. Not a git repository?");
log::debug!("Book root: {}", book_root.display());
log::debug!("Src root: {}", src_root.display());
log::debug!("Git root: {}", git_root.display());