clean command

This commit is contained in:
aaron-jack-manning
2022-08-22 18:58:13 +10:00
parent f43d583ae6
commit 6aa3eb4e83
3 changed files with 19 additions and 1 deletions

View File

@@ -296,4 +296,17 @@ pub fn list(vault_folder : &path::Path) -> Result<(), error::Error> {
Ok(())
}
pub fn clean(vault_folder : &path::Path) -> Result<(), error::Error> {
let tasks = Task::load_all(vault_folder, false)?;
for task in tasks {
if task.data.discarded {
task.delete()?;
}
}
Ok(())
}