Create recipe dir on save (#5337)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-23 14:19:01 -04:00
committed by GitHub
parent 0455b6cb8d
commit d2f4658d93
+4
View File
@@ -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)