Compare commits
2 commits
cdc0c02e37
...
cd7dc90657
Author | SHA1 | Date | |
---|---|---|---|
cd7dc90657 | |||
92a201981a |
2 changed files with 4 additions and 6 deletions
|
@ -9,7 +9,7 @@ edition = "2021"
|
||||||
pico-args = "0.5.0"
|
pico-args = "0.5.0"
|
||||||
termion = "2.0.1"
|
termion = "2.0.1"
|
||||||
toml = "0.7.6"
|
toml = "0.7.6"
|
||||||
upon = "0.7.1"
|
upon = "0.8.1"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
|
|
|
@ -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 content = read_to_string(path).unwrap();
|
||||||
let template = engine.compile(&content);
|
let template = engine.compile(&content);
|
||||||
if template.is_err() {
|
if let Err(error) = template {
|
||||||
let error = template.err().unwrap();
|
|
||||||
println!(" {BOLD}{FAILURE}failed to compile template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
println!(" {BOLD}{FAILURE}failed to compile template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// render
|
// render
|
||||||
println!(" {ITALIC}rendering{RESET}");
|
println!(" {ITALIC}rendering{RESET}");
|
||||||
let render = template.unwrap().render(&context).to_string();
|
let render = template.unwrap().render(&engine, &context).to_string();
|
||||||
if render.is_err() {
|
if let Err(error) = render {
|
||||||
let error = render.err().unwrap();
|
|
||||||
println!(" {BOLD}{FAILURE}failed to render template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
println!(" {BOLD}{FAILURE}failed to render template:{RESET}\n {FAILURE}{error}\n {BOLD}skipping{RESET}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue