diff --git a/crates/bevy_asset/src/io/file/mod.rs b/crates/bevy_asset/src/io/file/mod.rs index 6ee59fab37..25bd1e5175 100644 --- a/crates/bevy_asset/src/io/file/mod.rs +++ b/crates/bevy_asset/src/io/file/mod.rs @@ -75,16 +75,15 @@ impl FileAssetWriter { /// /// See `get_base_path` below. pub fn new + 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 } } }