Skip to content

Commit bf5b49d

Browse files
committed
Canonicalize CARGO_MANIFEST_DIR in case it's set as a relpath and causes crashes FileAssetIo's strip_prefix.
1 parent f1be89d commit bf5b49d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_asset/src/io/file_asset_io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl FileAssetIo {
6464
/// instead. It's set by cargo when running with `cargo run`.
6565
pub fn get_base_path() -> PathBuf {
6666
if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") {
67-
PathBuf::from(manifest_dir)
67+
fs::canonicalize(manifest_dir).unwrap()
6868
} else {
6969
env::current_exe()
7070
.map(|path| {

0 commit comments

Comments
 (0)