We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1be89d commit b1a786bCopy full SHA for b1a786b
crates/bevy_asset/src/io/file_asset_io.rs
@@ -64,7 +64,14 @@ impl FileAssetIo {
64
/// instead. It's set by cargo when running with `cargo run`.
65
pub fn get_base_path() -> PathBuf {
66
if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") {
67
- PathBuf::from(manifest_dir)
+ // Some Windows software don't support canonicalized path names, so let's avoid them
68
+ // unless the path is relative, in which case we currently need to make it absolute
69
+ // (See more: https://github.com/rust-lang/rust/issues/59117 )
70
+ if Path::new(&manifest_dir).is_relative() {
71
+ fs::canonicalize(&manifest_dir).unwrap_or_else(|_| PathBuf::from(manifest_dir))
72
+ } else {
73
+ PathBuf::from(manifest_dir)
74
+ }
75
} else {
76
env::current_exe()
77
.map(|path| {
0 commit comments