diff options
Diffstat (limited to 'src/command/add.rs')
| -rw-r--r-- | src/command/add.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/command/add.rs b/src/command/add.rs index 02da0fb..d38d077 100644 --- a/src/command/add.rs +++ b/src/command/add.rs @@ -1,12 +1,7 @@ +use super::{generate::Generate, sync_down::SyncDown, sync_up::SyncUp, update::Update}; +use crate::configuration::Configuration; use std::fs::{create_dir_all, remove_dir_all, rename}; use std::io::Result; -use super::{ - generate::Generate, - sync_down::SyncDown, - sync_up::SyncUp, - update::Update -}; -use crate::configuration::Configuration; pub struct Add; @@ -21,7 +16,7 @@ impl super::Command for Add { vec![Box::new(SyncDown::new())] } - fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> { + fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &str) -> Result<()> { create_dir_all(&configuration.posts_directory)?; for i in (0..configuration.max_posts - 1).rev() { let source = configuration.posts_directory.join(i.to_string()); @@ -41,7 +36,7 @@ impl super::Command for Add { vec![ Box::new(Update::new()), Box::new(Generate::new()), - Box::new(SyncUp::new()) + Box::new(SyncUp::new()), ] } |