From 1590faba5fb1d5358d29bc759140ce5c82045284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Thu, 7 Sep 2023 08:57:15 +0200 Subject: [PATCH 1/3] create imported asset directory if needed --- crates/bevy_asset/src/processor/log.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bevy_asset/src/processor/log.rs b/crates/bevy_asset/src/processor/log.rs index febe712ed2a5e..f95724f51972b 100644 --- a/crates/bevy_asset/src/processor/log.rs +++ b/crates/bevy_asset/src/processor/log.rs @@ -1,4 +1,4 @@ -use async_fs::File; +use async_fs::{DirBuilder, File}; use bevy_log::error; use bevy_utils::HashSet; use futures_lite::{AsyncReadExt, AsyncWriteExt}; @@ -89,6 +89,13 @@ impl ProcessorTransactionLog { } } + if let Some(parent_folder) = path.parent() { + DirBuilder::new() + .recursive(true) + .create(parent_folder) + .await?; + } + Ok(Self { log_file: File::create(path).await?, }) From 5a9e2e107f6e0c9c4a6318040c1bfb0a8e56abf1 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 7 Sep 2023 13:29:07 -0700 Subject: [PATCH 2/3] use create_dir_all --- crates/bevy_asset/src/processor/log.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/bevy_asset/src/processor/log.rs b/crates/bevy_asset/src/processor/log.rs index f95724f51972b..646cf737b1ca9 100644 --- a/crates/bevy_asset/src/processor/log.rs +++ b/crates/bevy_asset/src/processor/log.rs @@ -90,10 +90,7 @@ impl ProcessorTransactionLog { } if let Some(parent_folder) = path.parent() { - DirBuilder::new() - .recursive(true) - .create(parent_folder) - .await?; + async_fs::create_dir_all(parent_folder).await?; } Ok(Self { From ba5417c612d5b36ce7453b6fe83f2530592fa1bb Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 7 Sep 2023 13:30:24 -0700 Subject: [PATCH 3/3] remove unused --- crates/bevy_asset/src/processor/log.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_asset/src/processor/log.rs b/crates/bevy_asset/src/processor/log.rs index 646cf737b1ca9..0c1c3d93fbade 100644 --- a/crates/bevy_asset/src/processor/log.rs +++ b/crates/bevy_asset/src/processor/log.rs @@ -1,4 +1,4 @@ -use async_fs::{DirBuilder, File}; +use async_fs::File; use bevy_log::error; use bevy_utils::HashSet; use futures_lite::{AsyncReadExt, AsyncWriteExt};