mirror of
https://github.com/helix-editor/helix.git
synced 2024-09-19 23:21:21 +03:00
Canonicalize executable path
When looking up the runtime/ directory relative to the executable path, canonicalize the path first in case the executable is a symbolic link. Fixes #3768
This commit is contained in:
parent
ec81ec1e8d
commit
b5be72bff7
@ -42,8 +42,10 @@ pub fn runtime_dir() -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fallback to location of the executable being run
|
// fallback to location of the executable being run
|
||||||
|
// canonicalize the path in case the executable is symlinked
|
||||||
std::env::current_exe()
|
std::env::current_exe()
|
||||||
.ok()
|
.ok()
|
||||||
|
.and_then(|path| std::fs::canonicalize(path).ok())
|
||||||
.and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
|
.and_then(|path| path.parent().map(|path| path.to_path_buf().join(RT_DIR)))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user