Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Feb 6, 2023
1 parent 042c72d commit 1cef725
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,9 @@ pub fn render_template_file_tree<'a, T: Serialize>(
let value: serde_json::Value = serde_json::from_str(new_data.as_str())?;

for (path, maybe_contents) in flattened_templates {
let path = PathBuf::from(path.to_str().unwrap().replace('¡', "/"));
let path = PathBuf::from(path.to_str().unwrap().replace('\'', "\""));
if let Some(contents) = maybe_contents {
let path = PathBuf::from(path.to_str().unwrap().replace('¡', "/"));
let path = PathBuf::from(path.to_str().unwrap().replace('\'', "\""));

let re = Regex::new(
r"(?P<c>(.)*)/\{\{#each (?P<b>([^\{\}])*)\}\}(?P<a>(.)*)\{\{/each\}\}.hbs\z",
)
Expand Down Expand Up @@ -436,7 +435,8 @@ pub fn render_template_file_tree<'a, T: Serialize>(
}
}
} else {
transformed_templates.insert(path, None);
let new_path = h.render_template(path.as_os_str().to_str().unwrap(), data)?;
transformed_templates.insert(PathBuf::from(new_path), None);
}
}

Expand Down

0 comments on commit 1cef725

Please sign in to comment.