-use std::io::Result;
+use std::io::{Result};
+use crate::configuration::Configuration;
+use crate::remote::sync_down;
pub struct SyncDown;
vec![]
}
- fn execute(&self, input: Option<&String>) -> Result<()> {
- println!("Sync Down: {:?}!", input);
+ fn execute(&self, _: Option<&String>, configuration: &Configuration, command: &String) -> Result<()> {
+ match sync_down(&configuration.data_directory, &configuration.remote_config) {
+ Ok(_) => {}
+ Err(e) => {
+ if command == self.command() {
+ return Err(e)
+ }
+ }
+ }
return Ok(())
}
}
fn help(&self) -> &'static str {
- "\t\t\tPulls from the git remote if configured"
+ "\t\t\t\tPulls from the git remote if configured"
}
}