feat: add sync files\folders
This commit is contained in:
+4
-3
@@ -2,6 +2,7 @@ mod cli;
|
||||
mod config;
|
||||
mod local;
|
||||
mod ssh;
|
||||
mod sync;
|
||||
|
||||
use std::process::ExitCode;
|
||||
|
||||
@@ -93,10 +94,10 @@ fn run(cli: &cli::Cli) -> Result<()> {
|
||||
session = Some(ssh::connect(&resolved)?);
|
||||
}
|
||||
|
||||
if !project.sync.is_empty() {
|
||||
println!("stage 4 not implemented yet: SFTP file transfer");
|
||||
}
|
||||
if let Some(session) = session.as_mut() {
|
||||
for rule in &project.sync {
|
||||
sync::upload(session, &rule.source, &rule.target.to_string_lossy())?;
|
||||
}
|
||||
for cmd in remote_cmds {
|
||||
session.exec(cmd)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user