feat: add output pipeline

This commit is contained in:
2026-08-23 05:54:38 +05:00
parent 27cf814c39
commit eeb5aa9e84
6 changed files with 173 additions and 93 deletions
+2 -8
View File
@@ -190,12 +190,7 @@ pub(crate) fn runtime() -> &'static tokio::runtime::Runtime {
}
pub fn connect(resolved: &Resolved) -> Result<Session> {
println!(
"connecting to {}@{} (key {}) ...",
resolved.user,
format_host_port(&resolved.host, resolved.port),
resolved.key_path.display()
);
println!("connecting...");
runtime().block_on(async {
let handler = ClientHandler {
host: resolved.host.clone(),
@@ -248,7 +243,6 @@ async fn authenticate(handle: &mut Handle<ClientHandler>, r: &Resolved) -> Resul
impl Session {
pub fn exec(&mut self, cmd: &str) -> Result<()> {
println!("[Remote] running: {cmd} ...");
runtime().block_on(async {
use std::io::Write;
@@ -286,7 +280,7 @@ impl Session {
} else {
format!("\nstderr:\n{stderr}")
};
bail!("[Remote] running: {cmd} ... FAILED (exit code {status}){tail}");
bail!("{cmd} FAILED (exit code {status}){tail}");
}
Ok(())
})