Compare commits

...

2 commits

Author SHA1 Message Date
cd7dc90657 updated dependency 2024-07-09 10:00:19 -04:00
92a201981a minor refactor 2024-07-09 09:55:35 -04:00
2 changed files with 4 additions and 6 deletions

View file

@ -9,7 +9,7 @@ edition = "2021"
pico-args = "0.5.0"
termion = "2.0.1"
toml = "0.7.6"
upon = "0.7.1"
upon = "0.8.1"
[profile.release]
opt-level = "s"

View file

@ -92,17 +92,15 @@ pub fn build(targets: &Vec<Map<String, Value>>, template_dir: String, config: &C
let content = read_to_string(path).unwrap();
let template = engine.compile(&content);
if template.is_err() {
let error = template.err().unwrap();
if let Err(error) = template {
println!(" {BOLD}{FAILURE}failed to compile template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
continue;
}
// render
println!(" {ITALIC}rendering{RESET}");
let render = template.unwrap().render(&context).to_string();
if render.is_err() {
let error = render.err().unwrap();
let render = template.unwrap().render(&engine, &context).to_string();
if let Err(error) = render {
println!(" {BOLD}{FAILURE}failed to render template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
continue;
}