Skip to content

Commit

Permalink
fix(panic): Fix panics caused by non-existent template paths
Browse files Browse the repository at this point in the history
As mentioned in Keats/tera#819, there was a regression in how
non-existent glob paths are handled. Previously, invalid globs would be
expanded to the empty set, but now they lead to an error.

Since this implementation just wants a bogus template directory, we just
load the `Tera::default()` template.

This should address google#545

Signed off by: Nick Groszewski <[email protected]>
  • Loading branch information
groszewn committed Mar 31, 2023
1 parent afe9b48 commit df8d89b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions impl/src/rendering/bazel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ fn bazel_package_name(render_details: &RenderDetails) -> String {

impl BazelRenderer {
pub fn new() -> Self {
// Configure tera with a bogus template dir: We don't want any runtime template support
let mut internal_renderer = Tera::new("/tmp/cargo-raze/doesnt/exist/*").unwrap();
let mut internal_renderer = Tera::default();
internal_renderer
.add_raw_templates(vec![
(
Expand Down

0 comments on commit df8d89b

Please sign in to comment.