This commit is contained in:
JMARyA 2023-11-01 22:43:04 +01:00
parent 2a268bb5cd
commit b2ae45131d
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 18 additions and 11 deletions

View file

@ -87,13 +87,20 @@ fn main() {
.quit_on_error("Schema is not valid");
let frontmatter = serde_yaml::from_str(
&get_frontmatter(
&std::fs::read_to_string(file).quit_on_error("Could not read markdown file"),
)
&get_frontmatter(&std::fs::read_to_string(file).quit_on_error(&format!(
"Could not read markdown file '{}'",
Style::new().blue().apply_to(file)
)))
.ok_or(0)
.quit_on_error("Could not parse frontmatter"),
.quit_on_error(&format!(
"Could not parse frontmatter '{}'",
Style::new().blue().apply_to(file)
)),
)
.quit_on_error("Frontmatter is no valid yaml");
.quit_on_error(&format!(
"Frontmatter is no valid yaml '{}'",
Style::new().blue().apply_to(file)
));
let result = comp_schema.validate(&frontmatter);