X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/36a4680d18de012e2e5c732f9db161dafa884344..172f4c8807d44ebe38c7f227b7fdc2d6a9dbe323:/src/command/sync_down.rs diff --git a/src/command/sync_down.rs b/src/command/sync_down.rs index dc4114e..bba34b2 100644 --- a/src/command/sync_down.rs +++ b/src/command/sync_down.rs @@ -1,6 +1,6 @@ -use std::fs::create_dir_all; -use std::io::{Result, Error}; +use std::io::{Result}; use crate::configuration::Configuration; +use crate::remote::sync_down; pub struct SyncDown; @@ -16,16 +16,10 @@ impl super::Command for SyncDown { } fn execute(&self, _: Option<&String>, configuration: &Configuration, command: &String) -> Result<()> { - match create_dir_all(&configuration.data_directory) { - Ok(_) => { - // We only care to show these warnings if this is the primary command. - if command == self.command() { - println!("WARNING: Sync Down Not yet implemented"); - } - return Ok(()) - }, - Err(e) => Err(Error::new(e.kind(), format!("Could not create data directory"))) + if command == self.command() { + return sync_down(&configuration.data_directory, &configuration.remote_config); } + return Ok(()) } fn after_dependencies(&self) -> Vec> {