X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/a9c6be4162bd15bd41ba3605127b56cb1eb32f32..b6798535a5796433d2fe13025b1750dd5353fd01:/src/command/sync_up.rs?ds=sidebyside diff --git a/src/command/sync_up.rs b/src/command/sync_up.rs index 635de10..c44e0b0 100644 --- a/src/command/sync_up.rs +++ b/src/command/sync_up.rs @@ -1,5 +1,6 @@ use std::io::Result; use crate::configuration::Configuration; +use crate::remote::sync_up; pub struct SyncUp; @@ -14,8 +15,15 @@ impl super::Command for SyncUp { vec![] } - fn execute(&self, input: Option<&String>, _: &Configuration, _: &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(()) }