From 1896ea04204b8086a4f25e257dc5605e5505d768 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 4 Apr 2024 01:13:09 +0200 Subject: driver: recipe: move each recipe into a separate directory --- crates/driver/src/recipe.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/driver/src/recipe.rs b/crates/driver/src/recipe.rs index ec1c116..3a033f1 100644 --- a/crates/driver/src/recipe.rs +++ b/crates/driver/src/recipe.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fs::File, path::Path, result}; +use std::{collections::HashMap, ffi::OsStr, fs::File, path::Path, result}; use scoped_tls_hkt::scoped_thread_local; use serde::{Deserialize, Deserializer}; @@ -47,8 +47,8 @@ fn read_recipe(path: &Path) -> Result { Ok(recipe) } -fn is_yml(path: &Path) -> bool { - path.extension() == Some("yml".as_ref()) +fn is_recipe(path: &Path) -> bool { + path.file_name().unwrap_or_default() == "build.yml" } pub fn read_recipes>(path: P) -> Result>> { @@ -60,11 +60,15 @@ pub fn read_recipes>(path: P) -> Result