-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(())
}