hooks: Run hooks in the order they were defined

Iterating over a `HashSet` produces items in an arbitrary order.  A
`BTreeSet`, on the other hand, produces items in the same order they
were inserted.  Thus, this structure is more appropriate, since the
execution order of hooks may be important in some cases.
master
Dustin 2024-01-18 19:48:13 -06:00
parent 1099fa40c7
commit 09bd82d1df
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
mod model;
mod templating;
use std::collections::HashSet;
use std::collections::BTreeSet;
use std::io::{Read, Seek, Write};
use std::path::{Path, PathBuf};
use std::process::Command;
@ -149,7 +149,7 @@ fn process_instructions(
);
let ctx = Context::from_serialize(&values)?;
let mut post_hooks = HashSet::new();
let mut post_hooks = BTreeSet::new();
for i in instructions.render {
let out = match tera.render(&i.template, &ctx) {
Ok(o) => o,