reconcile on add too
parent
7da6aa8ae9
commit
ee9377d6da
|
|
@ -8,11 +8,7 @@ fn main() {
|
|||
let files = flags.files().expect("failed to files");
|
||||
|
||||
if !flags.dry_run {
|
||||
for file in files.files.iter() {
|
||||
file.persist_stage()
|
||||
.expect("failed to persist staged changes to log file");
|
||||
file.stage_persisted().expect("failed to stage log files");
|
||||
}
|
||||
files.reconcile().expect("failed to reconcile");
|
||||
|
||||
if let Some(add) = flags.add {
|
||||
let task = match flags.add_schedule {
|
||||
|
|
@ -30,9 +26,8 @@ fn main() {
|
|||
Some(due) => Delta::add_at(task, due),
|
||||
})
|
||||
.expect("failed to add");
|
||||
files.files[0]
|
||||
.stage_persisted()
|
||||
.expect("failed to stage added");
|
||||
|
||||
files.reconcile().expect("failed to reconcile");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -146,6 +141,14 @@ impl Files {
|
|||
files: files.into_iter().map(|x| File::new(&x)).collect(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reconcile(&self) -> Result<(), String> {
|
||||
for file in self.files.iter() {
|
||||
file.persist_stage()?;
|
||||
file.stage_persisted()?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
Loading…
Reference in New Issue