feat: add a new .recover command for sessions to recover from errors
This commit is contained in:
@@ -699,6 +699,19 @@ impl Session {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn flush(&mut self) -> Result<()> {
|
||||
if !self.dirty {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(path) = self.path.clone() {
|
||||
let name = self.name.clone();
|
||||
self.save(&name, Path::new(&path), false)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn guard_empty(&self) -> Result<()> {
|
||||
if !self.is_empty() {
|
||||
bail!(
|
||||
|
||||
Reference in New Issue
Block a user