mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
Create recipe dir on save (#5337)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -177,6 +177,10 @@ pub fn save_recipe_to_file(recipe: Recipe, file_path: Option<PathBuf>) -> anyhow
|
||||
None => generate_recipe_filename(&recipe.title, &recipe_library_dir),
|
||||
};
|
||||
|
||||
if let Some(parent) = file_path_value.parent() {
|
||||
fs::create_dir_all(parent)?;
|
||||
}
|
||||
|
||||
let yaml_content = serde_yaml::to_string(&recipe)?;
|
||||
fs::write(&file_path_value, yaml_content)?;
|
||||
Ok(file_path_value)
|
||||
|
||||
Reference in New Issue
Block a user