load all recipes from repo
This commit is contained in:
parent
57b8dae357
commit
f28aeaf321
3 changed files with 68 additions and 10 deletions
|
|
@ -54,9 +54,18 @@ pub struct Recipe {
|
|||
outputs: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
pub fn validate_recipe(recipe: &Recipe) -> anyhow::Result<()> {
|
||||
// if recipe.inputs.len() == 0 {
|
||||
// Err("recipe has no inputs!");
|
||||
// }
|
||||
Ok(())
|
||||
impl Recipe {
|
||||
pub fn from_file(file: &std::path::PathBuf) -> anyhow::Result<Self> {
|
||||
let recipe_contents = std::fs::read_to_string(file)?;
|
||||
let recipe: Recipe = toml::from_str(&recipe_contents)?;
|
||||
// let r = recipe.validate_recipe();
|
||||
Ok(recipe)
|
||||
}
|
||||
|
||||
fn validate_recipe(self: &Self) -> anyhow::Result<()> {
|
||||
// if recipe.inputs.len() == 0 {
|
||||
// Err("recipe has no inputs!");
|
||||
// }
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue