use crate::configuration::Configuration; use crate::remote::sync_down; use std::io::Result; pub struct SyncDown; impl SyncDown { pub fn new() -> Self { SyncDown } } impl super::Command for SyncDown { fn before_dependencies(&self) -> Vec> { vec![] } 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); } } } Ok(()) } fn after_dependencies(&self) -> Vec> { vec![] } fn command(&self) -> &'static str { "sync-down" } fn help(&self) -> &'static str { "\t\t\t\tPulls from the git remote if configured" } }