Skip to content

Commit

Permalink
create imported asset directory if needed (bevyengine#9716)
Browse files Browse the repository at this point in the history
# Objective

- Related to bevyengine#9715 
- Example `asset_processing` logs the following error:
```
thread 'IO Task Pool (1)' panicked at 'Failed to initialize asset processor log. This cannot be recovered. Try restarting. If that doesn't work, try deleting processed asset folder. No such file or directory (os error 2)', crates/bevy_asset/src/processor/mod.rs:867:25
```

## Solution

- Create the log directory if needed

---------

Co-authored-by: Carter Anderson <[email protected]>
  • Loading branch information
mockersf and cart authored Sep 7, 2023
1 parent 5eb292d commit c8f61c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_asset/src/processor/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ impl ProcessorTransactionLog {
}
}

if let Some(parent_folder) = path.parent() {
async_fs::create_dir_all(parent_folder).await?;
}

Ok(Self {
log_file: File::create(path).await?,
})
Expand Down

0 comments on commit c8f61c3

Please sign in to comment.