Remove the need for a directory for db export

Plus on import use the context directory.  We can actually write there
just fine.
This commit is contained in:
Floris Bruynooghe
2023-02-16 16:06:41 +01:00
parent dcce6ef50b
commit 490a14c5ef
9 changed files with 48 additions and 48 deletions

View File

@@ -489,11 +489,11 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
.await?;
}
"send-backup" => {
let tdir = tempfile::TempDir::new()?;
let dir = tdir.path();
let provider = BackupProvider::prepare(&context, dir).await?;
let provider = BackupProvider::prepare(&context).await?;
let qr = provider.qr();
let rendered = deltachat::qr_code_generator::generate_backup_qr(&context, &qr).await?;
let tdir = tempfile::TempDir::new()?;
let dir = tdir.path();
let file = dir.join("qr.svg");
tokio::fs::write(&file, rendered).await?;
println!("The QR code is at: {}", file.display());