fix: create destination dirs

This commit is contained in:
Kieran 2024-09-26 15:36:12 +01:00
parent 12acdb118e
commit 65a37c98b4
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -1,3 +1,4 @@
use std::fs;
use anyhow::Error;
use chrono::{DateTime, Utc};
use clap::Parser;
@ -77,6 +78,8 @@ async fn migrate_file(
src_path.to_str().unwrap(),
dst_path.to_str().unwrap()
);
tokio::fs::create_dir_all(dst_path.parent().unwrap()).await?;
tokio::fs::copy(src_path, dst_path).await?;
} else if dst_path.exists() {
info!("File already exists {}, continuing...", &f.id);