Add support for pausing, aborting, and promisifying appdmg execution #184
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
appdmg
function (that is, the pipeline object):ee.waitFor(promise)
Pauses execution until the given
Promise
completes. 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
err
as the reason. It must be a truthy value, preferably anError
.ee.asPromise
A
Promise
that 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.