Add support for pausing, aborting, and promisifying appdmg execution#184
Open
argv-minus-one wants to merge 3 commits intoLinusU:masterfrom
Open
Add support for pausing, aborting, and promisifying appdmg execution#184argv-minus-one wants to merge 3 commits intoLinusU:masterfrom
argv-minus-one wants to merge 3 commits intoLinusU:masterfrom
Conversation
Previously, if the appdmg pipeline errored out during one of the tests, the error was swallowed and the test simply timed out after 60 seconds. Now, the test fails with the actual error.
• Document Pipeline#hasErrored. Set it to true before emitting step error events, rather than after, so that event handlers know that appdmg has entered an error state. • Make Pipeline#abort() do nothing if hasErrored is already true. • When the pipeline is waiting on multiple promises, wait for all of them, even if some of them reject. That way, no one gets surprised by appdmg starting cleanup too soon. • Don't throw rejections (just log them) from waitFor'd promises when hasErrored is already true. Prevents infinite loops.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some new methods and properties to the object returned by the
appdmgfunction (that is, the pipeline object):ee.waitFor(promise)
Pauses execution until the given
Promisecompletes. If the promise rejects, then the appdmg run is aborted. This lets you do custom asynchronous work on the disk image while it's being built.For example, suppose your disk image will contain a folder called “Super Secret Folder”, which you want to be hidden from the Finder. Here's how to do it, using the Xcode command-line tools:
ee.abort(err)
Abort the appdmg run with
erras the reason. It must be a truthy value, preferably anError.ee.asPromise
A
Promisethat completes when appdmg is finished.ee.temporaryImagePath
Path to the temporary disk image. This is a writable disk image that appdmg creates and mounts while it's working.
ee.temporaryMountPath
Path where the temporary disk image is currently mounted. This property is set when it's mounted, and deleted when it's unmounted.