fix
This commit is contained in:
parent
2a268bb5cd
commit
b2ae45131d
2 changed files with 18 additions and 11 deletions
17
src/main.rs
17
src/main.rs
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue