Merge branch 'beta' into codex/fix-failing-workflow-tests

This commit is contained in:
thePR0M3TH3AN
2025-05-21 19:48:56 -04:00
committed by GitHub

View File

@@ -107,10 +107,10 @@ fn main() -> Result<()> {
Commands::Restore { backup_path } => { Commands::Restore { backup_path } => {
drop(conn); drop(conn);
if backup_path.exists() { if backup_path.exists() { db::restore(&backup_path, &cfg.db_path)
db::restore(&backup_path, &cfg.db_path).with_context(|| { .with_context(|| {
format!("Failed to restore DB from {}", backup_path.display()) format!("Failed to restore DB from {}", backup_path.display())
})?; })?;
} else { } else {
let backups_dir = cfg.db_path.parent().unwrap().join("backups"); let backups_dir = cfg.db_path.parent().unwrap().join("backups");
let manager = BackupManager::new(&cfg.db_path, &backups_dir)?; let manager = BackupManager::new(&cfg.db_path, &backups_dir)?;
@@ -118,9 +118,12 @@ fn main() -> Result<()> {
.file_name() .file_name()
.and_then(|n| n.to_str()) .and_then(|n| n.to_str())
.context("invalid backup file name")?; .context("invalid backup file name")?;
manager.restore_from_backup(name).with_context(|| { manager
format!("Failed to restore DB from {}", backup_path.display()) .restore_from_backup(name)
})?; .with_context(|| {
format!("Failed to restore DB from {}", backup_path.display())
})?;
} }
println!("Restored DB from {}", backup_path.display()); println!("Restored DB from {}", backup_path.display());
db::open(&cfg.db_path).with_context(|| { db::open(&cfg.db_path).with_context(|| {