This commit is contained in:
JMARyA 2023-10-30 15:59:14 +01:00
parent 2844e68a88
commit 2a268bb5cd
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -37,7 +37,13 @@ pub fn get_frontmatter(markdown: &str) -> Option<String> {
fn require_everything(schema: &mut serde_json::Value) { fn require_everything(schema: &mut serde_json::Value) {
if let Some(schema_obj) = schema.as_object_mut() { if let Some(schema_obj) = schema.as_object_mut() {
if schema_obj.get("type").unwrap().as_str().unwrap() == "object" { if match schema_obj.get("type").unwrap() {
serde_json::Value::String(str) => str == "object",
serde_json::Value::Array(lst) => {
lst.contains(&serde_json::Value::String("object".into()))
}
_ => false,
} {
let keys: Vec<_> = schema_obj let keys: Vec<_> = schema_obj
.get("properties") .get("properties")
.unwrap() .unwrap()
@ -99,7 +105,11 @@ fn main() {
//println!("{file}: {:#?}", error); //println!("{file}: {:#?}", error);
let file = Style::new().blue().apply_to(file); let file = Style::new().blue().apply_to(if file.contains(' ') {
format!("\"{file}\"")
} else {
file.to_string()
});
let path = Style::new().bright().red().apply_to(path); let path = Style::new().bright().red().apply_to(path);
match error.kind { match error.kind {