mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-21 19:19:45 +00:00
Merge branch 'main' of github.com:roc-lang/roc into simplify_examples
This commit is contained in:
commit
eaacb86ad9
15 changed files with 271 additions and 170 deletions
|
@ -161,10 +161,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>>(
|
||||
pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a str, &'a str)>>(
|
||||
cmd_name: &str,
|
||||
stdin_vals: I,
|
||||
args: &[String],
|
||||
env: E,
|
||||
) -> Out {
|
||||
let mut cmd = Command::new(cmd_name);
|
||||
|
||||
|
@ -172,6 +173,10 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>>(
|
|||
cmd.arg(arg);
|
||||
}
|
||||
|
||||
for (env, val) in env.into_iter() {
|
||||
cmd.env(env, val);
|
||||
}
|
||||
|
||||
let mut child = cmd
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue