mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-13 22:32:35 +00:00
bail! in render() if specified theme directory does not exist
This commit is contained in:
parent
e1c2e1a753
commit
a60571321a
1 changed files with 7 additions and 1 deletions
|
@ -481,7 +481,13 @@ impl Renderer for HtmlHandlebars {
|
|||
let mut handlebars = Handlebars::new();
|
||||
|
||||
let theme_dir = match html_config.theme {
|
||||
Some(ref theme) => ctx.root.join(theme),
|
||||
Some(ref theme) => {
|
||||
let dir = ctx.root.join(theme);
|
||||
if !dir.is_dir() {
|
||||
bail!("theme dir {} does not exist", dir.display());
|
||||
}
|
||||
dir
|
||||
}
|
||||
None => ctx.root.join("theme"),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue