diff options
Diffstat (limited to 'src/command/sync_down.rs')
| -rw-r--r-- | src/command/sync_down.rs | 16 |
1 files changed, 5 insertions, 11 deletions
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<Box<dyn super::Command>> { |