Skip to content

Commit

Permalink
On macOS 10.13 and higher, use -launchAndReturnError: instead of the …
Browse files Browse the repository at this point in the history
…deprecated -launch (#15)
  • Loading branch information
CharlesJS authored and mxcl committed Oct 1, 2018
1 parent 500fdbf commit c7989bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/NSTask+AnyPromise.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ - (AnyPromise *)promise {
resolve([NSError errorWithDomain:PMKErrorDomain code:PMKTaskError userInfo:info]);
}
};
[self launch];

if (@available(macOS 10.13, *)) {
NSError *error = nil;

if (![self launchAndReturnError:&error]) {
resolve(error);
}
} else {
[self launch];
}
}];
}

Expand Down

0 comments on commit c7989bb

Please sign in to comment.