summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-06 12:08:08 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-06 12:08:08 +0200
commit3dac699970d4adf0ac0ec32b121123cb67108bbd (patch)
treecdc9664fe7f9ee2885bdef1d062729139831c2d4
parent4b77be1ab51e1a2f3914bc5218b2413ad40e5e7e (diff)
downloadrebel-3dac699970d4adf0ac0ec32b121123cb67108bbd.tar
rebel-3dac699970d4adf0ac0ec32b121123cb67108bbd.zip
driver: recipe: add comment regarding file sorting
-rw-r--r--crates/driver/src/recipe.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/driver/src/recipe.rs b/crates/driver/src/recipe.rs
index aa728c8..16d3751 100644
--- a/crates/driver/src/recipe.rs
+++ b/crates/driver/src/recipe.rs
@@ -146,6 +146,8 @@ pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, Vec<TaskD
for entry in WalkDir::new(path)
.sort_by(|a, b| {
+ // Files are sorted first by stem, then by extension, so that
+ // recipe.yml will always be read before recipe.NAME.yml
let stem_cmp = a.path().file_stem().cmp(&b.path().file_stem());
let ext_cmp = a.path().extension().cmp(&b.path().extension());
stem_cmp.then(ext_cmp)