Ignore deleted tasks
This commit is contained in:
parent
419bac6204
commit
243ebf67b1
15
home-manager/packages/rust-scripts/src/bin/update_tasks.rs
Normal file
15
home-manager/packages/rust-scripts/src/bin/update_tasks.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
extern crate rust_scripts;
|
||||
extern crate task_hookrs;
|
||||
|
||||
use rust_scripts::error::Result;
|
||||
use rust_scripts::update::update_tasks;
|
||||
use task_hookrs::cache::TaskCache;
|
||||
use task_hookrs::status::TaskStatus;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let mut cache = TaskCache::new(vec![TaskStatus::Deleted]);
|
||||
cache.load()?;
|
||||
update_tasks(&mut cache)?;
|
||||
cache.write()?;
|
||||
Ok(())
|
||||
}
|
|
@ -153,8 +153,8 @@ impl GeneratedTask for Task {
|
|||
}
|
||||
|
||||
fn check_ignores(cache: &TaskCache) -> Result<()> {
|
||||
if cache.ignore().len() > 0 {
|
||||
return Err("Don't use generate with a TaskCache with ignores".into());
|
||||
if *cache.ignore() != vec![TS::Deleted] {
|
||||
return Err("Don't use generate with a TaskCache with ignores other than 'TaskStatus::Deleted'".into());
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use uuid::Uuid;
|
|||
use task_hookrs::cache::TaskCache;
|
||||
use task_hookrs::task::{Task, TaskBuilder};
|
||||
use task_hookrs::priority::TaskPriority;
|
||||
use task_hookrs::status::TaskStatus;
|
||||
|
||||
use dialog::rofi::RofiDialogProvider;
|
||||
use dialog::DialogProvider;
|
||||
|
@ -183,7 +184,7 @@ impl Kassandra {
|
|||
Ok(Kassandra {
|
||||
state: get_state()?,
|
||||
dialog: RofiDialogProvider {},
|
||||
cache: TaskCache::new(vec![]),
|
||||
cache: TaskCache::new(vec![TaskStatus::Deleted]),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue