summaryrefslogtreecommitdiffstats
path: root/src/runner/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-10 22:19:22 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-10 22:51:35 -0500
commit3c18ba5b58f4239054e809b07d795308f75b8602 (patch)
treeaa7cf2648335996220eff4619e7b0ae6aacd77fa /src/runner/mod.rs
parentee5aef94bb86caf64ca5fdcd77a7619ce8680a16 (diff)
downloadnbsh-3c18ba5b58f4239054e809b07d795308f75b8602.tar.gz
nbsh-3c18ba5b58f4239054e809b07d795308f75b8602.zip
implement globbing
Diffstat (limited to 'src/runner/mod.rs')
-rw-r--r--src/runner/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runner/mod.rs b/src/runner/mod.rs
index 6d080b8..86fb1b4 100644
--- a/src/runner/mod.rs
+++ b/src/runner/mod.rs
@@ -143,7 +143,10 @@ async fn run_commands(
if stack.should_execute() {
list.clone()
.into_iter()
- .flat_map(|w| w.eval(env))
+ .map(|w| w.eval(env).map(IntoIterator::into_iter))
+ .collect::<Result<Vec<std::vec::IntoIter<_>>, _>>()?
+ .into_iter()
+ .flatten()
.collect()
} else {
vec![]
@@ -240,7 +243,7 @@ fn spawn_children<'a>(
env: &'a Env,
io: &builtins::Io,
) -> anyhow::Result<(Vec<Child<'a>>, Option<nix::unistd::Pid>)> {
- let pipeline = pipeline.eval(env);
+ let pipeline = pipeline.eval(env)?;
let mut cmds: Vec<_> = pipeline
.into_exes()
.map(|exe| Command::new(exe, io.clone()))