use std::fs::create_dir_all; use std::io::{Result, Error}; use crate::configuration::Configuration; pub struct SyncDown; impl SyncDown { pub fn new() -> Self { SyncDown } } impl super::Command for SyncDown { fn before_dependencies(&self) -> Vec> { vec![] } 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"))) } } fn after_dependencies(&self) -> Vec> { vec![] } fn command(&self) -> &'static str { "sync-down" } fn help(&self) -> &'static str { "\t\t\t\tPulls from the git remote if configured" } }