Skip to content

Commit

Permalink
bail! in render() if specified theme directory does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2026 committed Apr 26, 2022
1 parent e1c2e1a commit a605713
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
};

Expand Down

0 comments on commit a605713

Please sign in to comment.