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 <mcanders1@gmail.com>
  • Loading branch information
2 people authored and Ray Redondo committed Jan 9, 2024
1 parent 78f230e commit afdc130
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 afdc130

Please sign in to comment.