feat: add output pipeline
This commit is contained in:
+2
-8
@@ -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(())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user