mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
create an app bundle and package it in dmg
Fix resource lookup, add package prefs fix tidy issues
This commit is contained in:
parent
00af25b685
commit
96b7a19ca0
5 changed files with 164 additions and 42 deletions
|
@ -39,20 +39,13 @@ pub fn resources_dir_path() -> PathBuf {
|
|||
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.push("resources");
|
||||
if !path.is_dir() { // resources dir not in same dir as exe?
|
||||
// exe is probably in target/{debug,release} so we need to go back to topdir
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.pop();
|
||||
|
||||
while path.pop() {
|
||||
path.push("resources");
|
||||
if !path.is_dir() {
|
||||
// exe is probably in target/$target_triple/{debug,release} so go back one more
|
||||
path.pop();
|
||||
path.pop();
|
||||
path.push("resources");
|
||||
if path.is_dir() {
|
||||
break;
|
||||
}
|
||||
path.pop();
|
||||
}
|
||||
*dir = Some(path.to_str().unwrap().to_owned());
|
||||
path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue