diff --git a/datman/src/commands/backup.rs b/datman/src/commands/backup.rs index d7c1658..18b4f03 100644 --- a/datman/src/commands/backup.rs +++ b/datman/src/commands/backup.rs @@ -265,6 +265,7 @@ pub fn backup_source_to_destination( gid_lookup: Default::default(), }; pile.write_pointer(&pointer_name, &pointer_data)?; + pile.flush()?; eprintln!("Pointer saved!"); } diff --git a/datman/src/remote/backup_source_requester.rs b/datman/src/remote/backup_source_requester.rs index 630f647..68611ac 100644 --- a/datman/src/remote/backup_source_requester.rs +++ b/datman/src/remote/backup_source_requester.rs @@ -229,6 +229,7 @@ pub fn backup_remote_source_to_destination )?; quit(&mut read, &mut write)?; + pile.flush()?; info!("Stored! Checking for existence..."); if pile.list_pointers()?.contains(&pointer_name) { diff --git a/yama/src/bin/yama.rs b/yama/src/bin/yama.rs index d9aa5a5..366da05 100644 --- a/yama/src/bin/yama.rs +++ b/yama/src/bin/yama.rs @@ -168,6 +168,8 @@ fn wrapped_main() -> anyhow::Result { bail!("You need to specify either --shallow or --deep."); }; + pile.flush()?; + if error_count > 0 { eprintln!("THERE ARE {} ERRORS.", error_count); return Ok(1); @@ -188,8 +190,10 @@ fn wrapped_main() -> anyhow::Result { Ok(command) => { if let Err(e) = debug_command(&pdesc, &pile, command) { eprintln!("Failed {:?}", e); + pile.flush()?; return Ok(2); } else { + pile.flush()?; return Ok(0); } } @@ -227,6 +231,7 @@ fn wrapped_main() -> anyhow::Result { let (other_pile, other_rp_bypass) = open_pile_with_work_bypass(&other_pile_path, &descriptor_other, bypass_level)?; + // TODO flush the pile after here yet push_to( Arc::new(this_pile), this_rp_bypass, diff --git a/yama/src/debug.rs b/yama/src/debug.rs index a4f74d4..0c03704 100644 --- a/yama/src/debug.rs +++ b/yama/src/debug.rs @@ -85,6 +85,9 @@ pub fn debug_prompt(pdesc: PileDescriptor, pile: Pile) -> anyho } } } + + pile.flush()?; + rl.save_history(".yama-history").unwrap(); Ok(()) diff --git a/yama/src/operations/storing.rs b/yama/src/operations/storing.rs index 6662efa..309c1d1 100644 --- a/yama/src/operations/storing.rs +++ b/yama/src/operations/storing.rs @@ -276,6 +276,6 @@ pub fn store_fully( }; pile.write_pointer(&new_pointer_name, &pointer_data)?; - + pile.flush()?; Ok(()) }