]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/sync_up.rs
Allow sync up and down
[rbdr/blog] / src / command / sync_up.rs
index cf49518e0fea2825fa1e09a4c6db0a7b5510492e..a5d2a4cfc5cb817401c4fcb1eb3ef5ea11c1c162 100644 (file)
@@ -1,4 +1,6 @@
 use std::io::Result;
+use crate::configuration::Configuration;
+use crate::remote::sync_up;
 
 pub struct SyncUp;
 
@@ -13,9 +15,8 @@ impl super::Command for SyncUp {
         vec![]
     }
 
-    fn execute(&self, input: Option<&String>) -> Result<()> {
-        println!("Sync Up: {:?}!", input);
-        return Ok(())
+    fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
+        sync_up(&configuration.data_directory, &configuration.remote_config)
     }
 
     fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
@@ -27,6 +28,6 @@ impl super::Command for SyncUp {
     }
 
     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"
     }
 }