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
parent
1099fa40c7
commit
09bd82d1df
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue