Merge branch 'main' into colorize
This commit is contained in:
commit
fdb052cfe1
4 changed files with 11 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "oink"
|
||||
version = "0.0.1"
|
||||
version = "0.0.2"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
4
rust-toolchain.toml
Normal file
4
rust-toolchain.toml
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
[toolchain]
|
||||
channel = "nightly"
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
#![feature(error_in_core)]
|
||||
use std::process::exit;
|
||||
|
||||
use pico_args::Arguments;
|
||||
|
|
|
@ -5,6 +5,7 @@ use std::{
|
|||
io::Write,
|
||||
path::Path
|
||||
};
|
||||
use core::error::Error;
|
||||
|
||||
use tera::{ Context, Tera };
|
||||
use termion::{
|
||||
|
@ -70,7 +71,10 @@ pub fn build(targets: &Vec<Map<String, Value>>, tera: &mut Tera, context: &Conte
|
|||
let render = tera.render(name, context);
|
||||
// handle rendering errors gracefully
|
||||
if render.is_err() {
|
||||
println!(" failed to render template");
|
||||
let error = render.err().unwrap();
|
||||
let message = error.source().unwrap();
|
||||
|
||||
println!(" failed to render template:\n {message}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue