mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #11899 - ConnorGBrewster:app_packaging, r=larsbergstrom
Create Servo.app and dmg on mac package <!-- Please describe your changes on the following line: --> This creates Servo.app and puts it in a dmg along with a symlink to `/Applications`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because creating packager <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11899) <!-- Reviewable:end -->
This commit is contained in:
commit
7b2080c5b7
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