Make dependencies execute in order they appear
It doesn't seem particularly valuable for dependencies to execute in any order, so make Recipe.dependencies a vec so they execute in order.
This commit is contained in:
parent
fbe8c07d43
commit
e5efa3f7d5
2
justfile
2
justfile
@ -24,6 +24,8 @@ create:
|
|||||||
clean:
|
clean:
|
||||||
rm -r tmp
|
rm -r tmp
|
||||||
|
|
||||||
|
polyglot: python js perl sh ruby
|
||||||
|
|
||||||
python:
|
python:
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
print('Hello from python!')
|
print('Hello from python!')
|
||||||
|
@ -50,7 +50,7 @@ pub struct Recipe<'a> {
|
|||||||
name: &'a str,
|
name: &'a str,
|
||||||
leading_whitespace: &'a str,
|
leading_whitespace: &'a str,
|
||||||
lines: Vec<&'a str>,
|
lines: Vec<&'a str>,
|
||||||
dependencies: BTreeSet<&'a str>,
|
dependencies: Vec<&'a str>,
|
||||||
shebang: bool,
|
shebang: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,15 +502,15 @@ pub fn parse<'a>(text: &'a str) -> Result<Justfile, Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let rest = captures.at(2).unwrap().trim();
|
let rest = captures.at(2).unwrap().trim();
|
||||||
let mut dependencies = BTreeSet::new();
|
let mut dependencies = vec![];
|
||||||
for part in whitespace_re.split(rest) {
|
for part in whitespace_re.split(rest) {
|
||||||
if name_re.is_match(part) {
|
if name_re.is_match(part) {
|
||||||
if dependencies.contains(part) {
|
if dependencies.contains(&part) {
|
||||||
return Err(error(text, i, ErrorKind::DuplicateDependency{
|
return Err(error(text, i, ErrorKind::DuplicateDependency{
|
||||||
name: part,
|
name: part,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
dependencies.insert(part);
|
dependencies.push(part);
|
||||||
} else {
|
} else {
|
||||||
return Err(error(text, i, ErrorKind::UnparsableDependencies));
|
return Err(error(text, i, ErrorKind::UnparsableDependencies));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user