mirror of
https://github.com/servo/servo.git
synced 2025-06-19 06:38:59 +01:00
Auto merge of #9643 - paulrouget:resolveSymlink, r=larsbergstrom
Follow executable symlink to resolve resources directory We need this if we ever want to be able to install Servo, for example: https://github.com/paulrouget/homebrew-servo <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9643) <!-- Reviewable:end -->
This commit is contained in:
commit
c193f0f3a2
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