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