mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
when finding resource_dir, try exe launch directory
external apps using servo may just have the resources/ in the same place
This commit is contained in:
parent
082479344f
commit
ac6aa9b8b7
1 changed files with 13 additions and 4 deletions
|
@ -25,14 +25,23 @@ pub fn resources_dir_path() -> PathBuf {
|
|||
// or `<servo source>/components/servo/target/release`.
|
||||
let mut path = env::current_exe().ok().expect("can't get exe path");
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.push("resources");
|
||||
if !path.is_dir() { // self_exe_path() is probably in .../target/release
|
||||
if !path.is_dir() { // resources dir not in same dir as exe?
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.push("resources");
|
||||
if !path.is_dir() { // self_exe_path() is probably in .../target/release
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.push("resources");
|
||||
if !path.is_dir() { // self_exe_path() is probably in .../target/release
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.push("resources");
|
||||
}
|
||||
}
|
||||
}
|
||||
path
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue