use std::io::Result;
+use crate::configuration::Configuration;
+use crate::remote::sync_up;
pub struct SyncUp;
vec![]
}
- fn execute(&self, input: Option<&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(())
}
}
fn help(&self) -> &'static str {
- "\t\t\t\tPushes to the git remote if configured."
+ "\t\t\t\tPushes to the git remote if configured"
}
}