summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-09 22:46:15 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-09 22:46:15 -0500
commitcba75be9c673b846ad0c4f6f5f2e8461056582ad (patch)
treec755fdea87b947cc62984da060220acfa46e8a0d
parent973346c5e426d6a1b684d36ba779bf3e8f5b71b1 (diff)
downloadnbsh-cba75be9c673b846ad0c4f6f5f2e8461056582ad.tar.gz
nbsh-cba75be9c673b846ad0c4f6f5f2e8461056582ad.zip
rename
since this doesn't just run pipelines anymore
-rw-r--r--src/main.rs4
-rw-r--r--src/runner/builtins/command.rs (renamed from src/pipeline/builtins/command.rs)10
-rw-r--r--src/runner/builtins/mod.rs (renamed from src/pipeline/builtins/mod.rs)10
-rw-r--r--src/runner/command.rs (renamed from src/pipeline/command.rs)2
-rw-r--r--src/runner/mod.rs (renamed from src/pipeline/mod.rs)2
-rw-r--r--src/runner/prelude.rs (renamed from src/pipeline/prelude.rs)0
-rw-r--r--src/shell/history/mod.rs6
7 files changed, 17 insertions, 17 deletions
diff --git a/src/main.rs b/src/main.rs
index c240e11..2096b46 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -17,13 +17,13 @@ mod format;
mod info;
mod mutex;
mod parse;
-mod pipeline;
mod prelude;
+mod runner;
mod shell;
async fn async_main() -> anyhow::Result<i32> {
if std::env::args().nth(1).as_deref() == Some("--internal-cmd-runner") {
- return pipeline::run().await;
+ return runner::run().await;
}
shell::run().await
diff --git a/src/pipeline/builtins/command.rs b/src/runner/builtins/command.rs
index 40498fc..2c1f755 100644
--- a/src/pipeline/builtins/command.rs
+++ b/src/runner/builtins/command.rs
@@ -1,4 +1,4 @@
-use crate::pipeline::prelude::*;
+use crate::runner::prelude::*;
use async_std::io::prelude::BufReadExt as _;
@@ -107,7 +107,7 @@ impl Cfg {
self.pre_exec = Some(Box::new(f));
}
- pub fn setup_command(mut self, cmd: &mut crate::pipeline::Command) {
+ pub fn setup_command(mut self, cmd: &mut crate::runner::Command) {
self.io.setup_command(cmd);
if let Some(pre_exec) = self.pre_exec.take() {
// Safety: pre_exec can only have been set by calling the pre_exec
@@ -245,7 +245,7 @@ impl Io {
}
}
- pub fn setup_command(mut self, cmd: &mut crate::pipeline::Command) {
+ pub fn setup_command(mut self, cmd: &mut crate::runner::Command) {
if let Some(stdin) = self.fds.remove(&0) {
if let Some(stdin) = crate::mutex::unwrap(stdin) {
let stdin = stdin.into_raw_fd();
@@ -348,7 +348,7 @@ pub struct Child<'a> {
+ 'a,
>,
>,
- wrapped_child: Option<Box<crate::pipeline::Child<'a>>>,
+ wrapped_child: Option<Box<crate::runner::Child<'a>>>,
}
impl<'a> Child<'a> {
@@ -365,7 +365,7 @@ impl<'a> Child<'a> {
}
}
- pub fn new_wrapped(child: crate::pipeline::Child<'a>) -> Self {
+ pub fn new_wrapped(child: crate::runner::Child<'a>) -> Self {
Self {
fut: Box::pin(async move { unreachable!() }),
wrapped_child: Some(Box::new(child)),
diff --git a/src/pipeline/builtins/mod.rs b/src/runner/builtins/mod.rs
index 4e9cf2a..dec4dc2 100644
--- a/src/pipeline/builtins/mod.rs
+++ b/src/runner/builtins/mod.rs
@@ -1,4 +1,4 @@
-use crate::pipeline::prelude::*;
+use crate::runner::prelude::*;
pub mod command;
pub use command::{Child, Command, File, Io};
@@ -258,7 +258,7 @@ fn and(
) -> anyhow::Result<command::Child> {
exe.shift();
if env.latest_status().success() {
- let mut cmd = crate::pipeline::Command::new(exe);
+ let mut cmd = crate::runner::Command::new(exe);
cfg.setup_command(&mut cmd);
Ok(command::Child::new_wrapped(cmd.spawn(env)?))
} else {
@@ -277,7 +277,7 @@ fn or(
let status = *env.latest_status();
Ok(command::Child::new_fut(async move { status }))
} else {
- let mut cmd = crate::pipeline::Command::new(exe);
+ let mut cmd = crate::runner::Command::new(exe);
cfg.setup_command(&mut cmd);
Ok(command::Child::new_wrapped(cmd.spawn(env)?))
}
@@ -289,7 +289,7 @@ fn command(
cfg: command::Cfg,
) -> anyhow::Result<command::Child> {
exe.shift();
- let mut cmd = crate::pipeline::Command::new_binary(exe);
+ let mut cmd = crate::runner::Command::new_binary(exe);
cfg.setup_command(&mut cmd);
Ok(command::Child::new_wrapped(cmd.spawn(env)?))
}
@@ -300,7 +300,7 @@ fn builtin(
cfg: command::Cfg,
) -> anyhow::Result<command::Child> {
exe.shift();
- let mut cmd = crate::pipeline::Command::new_builtin(exe);
+ let mut cmd = crate::runner::Command::new_builtin(exe);
cfg.setup_command(&mut cmd);
Ok(command::Child::new_wrapped(cmd.spawn(env)?))
}
diff --git a/src/pipeline/command.rs b/src/runner/command.rs
index 70fbe9f..34b770e 100644
--- a/src/pipeline/command.rs
+++ b/src/runner/command.rs
@@ -1,4 +1,4 @@
-use crate::pipeline::prelude::*;
+use crate::runner::prelude::*;
pub struct Command {
inner: Inner,
diff --git a/src/pipeline/mod.rs b/src/runner/mod.rs
index ebaf8e6..3d4d025 100644
--- a/src/pipeline/mod.rs
+++ b/src/runner/mod.rs
@@ -1,4 +1,4 @@
-use crate::pipeline::prelude::*;
+use crate::runner::prelude::*;
mod builtins;
mod command;
diff --git a/src/pipeline/prelude.rs b/src/runner/prelude.rs
index 53b67fc..53b67fc 100644
--- a/src/pipeline/prelude.rs
+++ b/src/runner/prelude.rs
diff --git a/src/shell/history/mod.rs b/src/shell/history/mod.rs
index 429545b..b241ca5 100644
--- a/src/shell/history/mod.rs
+++ b/src/shell/history/mod.rs
@@ -374,7 +374,7 @@ async fn spawn_commands(
let mut exit_done = None;
loop {
enum Res {
- Read(bincode::Result<crate::pipeline::Event>),
+ Read(bincode::Result<crate::runner::Event>),
Exit(std::io::Result<std::process::ExitStatus>),
}
@@ -389,11 +389,11 @@ async fn spawn_commands(
};
match read.or(exit).await {
Res::Read(Ok(event)) => match event {
- crate::pipeline::Event::Suspend(idx) => {
+ crate::runner::Event::Suspend(idx) => {
event_w.send(Event::ChildSuspend(idx)).await.unwrap();
new_read();
}
- crate::pipeline::Event::Exit(new_env) => {
+ crate::runner::Event::Exit(new_env) => {
*env = new_env;
read_done = true;
}