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