summaryrefslogtreecommitdiffstats
path: root/src/shell/history/mod.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-07 23:42:32 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-08 00:00:57 -0500
commit9dd1d992bd2344d8824e69d8f47c9009a6caf021 (patch)
treea2b3682c41a182bbb3b031e5c458ff93c460e53f /src/shell/history/mod.rs
parenta2d265ce727caf4e8cd4bad034ef8ae830346fc3 (diff)
downloadnbsh-9dd1d992bd2344d8824e69d8f47c9009a6caf021.tar.gz
nbsh-9dd1d992bd2344d8824e69d8f47c9009a6caf021.zip
large refactor
Diffstat (limited to 'src/shell/history/mod.rs')
-rw-r--r--src/shell/history/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs
index 7cd37fc..8ff9ccc 100644
--- a/src/shell/history/mod.rs
+++ b/src/shell/history/mod.rs
@@ -88,7 +88,7 @@ impl History {
pub async fn run(
&mut self,
- ast: crate::parse::Commands,
+ ast: crate::parse::ast::Commands,
env: &Env,
event_w: async_std::channel::Sender<Event>,
) -> anyhow::Result<usize> {
@@ -269,7 +269,7 @@ impl std::iter::DoubleEndedIterator for VisibleEntries {
}
fn run_commands(
- ast: crate::parse::Commands,
+ ast: crate::parse::ast::Commands,
entry: async_std::sync::Arc<async_std::sync::Mutex<Entry>>,
mut env: Env,
input_r: async_std::channel::Receiver<Vec<u8>>,
@@ -299,7 +299,8 @@ fn run_commands(
}
};
- for pipeline in ast.pipelines() {
+ let commands = ast.eval(&env);
+ for pipeline in commands.pipelines() {
env.set_pipeline(pipeline.input_string().to_string());
match run_pipeline(&pty, &mut env, event_w.clone()).await {
Ok((pipeline_status, done)) => {