X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/172f4c8807d44ebe38c7f227b7fdc2d6a9dbe323..b17907faf8d9693cef94a6048d802bd4ced9102f:/src/command/sync_down.rs?ds=sidebyside diff --git a/src/command/sync_down.rs b/src/command/sync_down.rs index bba34b2..f9122d4 100644 --- a/src/command/sync_down.rs +++ b/src/command/sync_down.rs @@ -1,6 +1,6 @@ -use std::io::{Result}; use crate::configuration::Configuration; use crate::remote::sync_down; +use std::io::Result; pub struct SyncDown; @@ -15,11 +15,21 @@ impl super::Command for SyncDown { vec![] } - fn execute(&self, _: Option<&String>, configuration: &Configuration, command: &String) -> Result<()> { - if command == self.command() { - return sync_down(&configuration.data_directory, &configuration.remote_config); + fn execute( + &self, + _: Option<&String>, + configuration: &Configuration, + command: &str, + ) -> Result<()> { + match sync_down(&configuration.data_directory, &configuration.remote_config) { + Ok(()) => {} + Err(e) => { + if command == self.command() { + return Err(e); + } + } } - return Ok(()) + Ok(()) } fn after_dependencies(&self) -> Vec> { @@ -34,4 +44,3 @@ impl super::Command for SyncDown { "\t\t\t\tPulls from the git remote if configured" } } -