mirror of
https://github.com/servo/servo.git
synced 2025-07-29 18:20:24 +01:00
Follow executable symlink to resolve resources directory
This commit is contained in:
parent
c9b2ef5c7f
commit
76f63c3569
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,8 @@ pub fn resources_dir_path() -> PathBuf {
|
||||||
// under `<servo source>[/$target_triple]/target/debug`
|
// under `<servo source>[/$target_triple]/target/debug`
|
||||||
// or `<servo source>[/$target_triple]/target/release`.
|
// or `<servo source>[/$target_triple]/target/release`.
|
||||||
let mut path = env::current_exe().expect("can't get exe path");
|
let mut path = env::current_exe().expect("can't get exe path");
|
||||||
|
// Follow symlink
|
||||||
|
path = path.canonicalize().expect("path does not exist");
|
||||||
path.pop();
|
path.pop();
|
||||||
path.push("resources");
|
path.push("resources");
|
||||||
if !path.is_dir() { // resources dir not in same dir as exe?
|
if !path.is_dir() { // resources dir not in same dir as exe?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue