X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/2f579cf4c0d8ff95af78103783c7ca8f951cc797..2c2e1c084c5b243837b8d644e30407b679167df7:/src/command/sync_up.rs?ds=inline diff --git a/src/command/sync_up.rs b/src/command/sync_up.rs index d35ce7f..c44e0b0 100644 --- a/src/command/sync_up.rs +++ b/src/command/sync_up.rs @@ -1,4 +1,6 @@ use std::io::Result; +use crate::configuration::Configuration; +use crate::remote::sync_up; pub struct SyncUp; @@ -13,8 +15,15 @@ impl super::Command for SyncUp { vec![] } - fn execute(&self, input: Option<&String>) -> Result<()> { - println!("Sync Up: {:?}!", input); + fn execute(&self, _: Option<&String>, configuration: &Configuration, command: &String) -> Result<()> { + match sync_up(&configuration.data_directory, &configuration.remote_config) { + Ok(_) => {} + Err(e) => { + if command == self.command() { + return Err(e) + } + } + } return Ok(()) }