diff --git a/common/src/errors.rs b/common/src/errors.rs index 7bb306c7..4a9f2e83 100644 --- a/common/src/errors.rs +++ b/common/src/errors.rs @@ -75,9 +75,8 @@ impl From for MegaError { } #[derive(Error, Debug)] -#[allow(unused)] pub enum GitLFSError { - #[error("Something went wrong in Git LFS")] + #[error("Something went wrong in Git LFS: {0}")] GeneralError(String), } diff --git a/libra/src/internal/protocol/lfs_client.rs b/libra/src/internal/protocol/lfs_client.rs index 8b710540..85c914e3 100644 --- a/libra/src/internal/protocol/lfs_client.rs +++ b/libra/src/internal/protocol/lfs_client.rs @@ -472,6 +472,9 @@ impl LFSClient { // infer that all chunks share same size! (except last one) let chunk_size = chunks.first().unwrap().size as usize; let mut checksum = Context::new(&SHA256); + if let Some(parent) = path.as_ref().parent() { + tokio::fs::create_dir_all(parent).await?; + } let mut file = tokio::fs::File::create(path).await?; for (i, chunk) in chunks.iter().enumerate() { // TODO parallel download println!("- part: {}/{}", i + 1, chunks.len());