mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Create imported_assets directory with full path (#12022)
# Objective - The file asset source currently creates the `imported_assets/Default` directory with relative path, which leads to wrongly created directories when the executable is run with a working directory different from the project root. ## Solution - Use the full path instead.
This commit is contained in:
parent
e64c8f8b7a
commit
11a3b77811
1 changed files with 4 additions and 5 deletions
|
@ -75,16 +75,15 @@ impl FileAssetWriter {
|
|||
///
|
||||
/// See `get_base_path` below.
|
||||
pub fn new<P: AsRef<Path> + std::fmt::Debug>(path: P, create_root: bool) -> Self {
|
||||
let root_path = get_base_path().join(path.as_ref());
|
||||
if create_root {
|
||||
if let Err(e) = std::fs::create_dir_all(&path) {
|
||||
if let Err(e) = std::fs::create_dir_all(&root_path) {
|
||||
error!(
|
||||
"Failed to create root directory {:?} for file asset writer: {:?}",
|
||||
path, e
|
||||
root_path, e
|
||||
);
|
||||
}
|
||||
}
|
||||
Self {
|
||||
root_path: get_base_path().join(path.as_ref()),
|
||||
}
|
||||
Self { root_path }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue