]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/sync_up.rs
Add mac
[rbdr/blog] / src / command / sync_up.rs
index d35ce7ffd2d41a20c4ae339f6635843f8c4bf53b..c44e0b03b375e782ef6aca4dbd664e10f6daa088 100644 (file)
@@ -1,4 +1,6 @@
 use std::io::Result;
+use crate::configuration::Configuration;
+use crate::remote::sync_up;
 
 pub struct SyncUp;
 
@@ -13,8 +15,15 @@ impl super::Command for 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(())
     }