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 -5
View File
@@ -32,8 +32,7 @@ fn human_size(bytes: u64) -> String {
}
pub fn upload(session: &mut Session, source: &Path, target: &str) -> Result<Stats> {
println!("[SFTP] transferring {} -> {} ...", source.display(), target);
let stats = runtime().block_on(async {
runtime().block_on(async {
if source.is_dir() {
upload_dir(session, source, target).await
} else if source.is_file() {
@@ -41,9 +40,7 @@ pub fn upload(session: &mut Session, source: &Path, target: &str) -> Result<Stat
} else {
bail!("sync source '{}' does not exist", source.display());
}
})?;
println!("[SFTP] ... Done! ({stats})");
Ok(stats)
})
}
async fn open_sftp(session: &mut Session) -> Result<SftpSession> {