In order to make this possible, I've added a new `sync()` method to the
Shellable protocol, which now should allow us to run shell commands
synchronously. Back to basics, as this was how *all* commands were
run in legacy versions of PHP Monitor.
The advantage here is that there is now a choice. Previously, you'd
have to use the `system()` helper that I added.
Usage of that helper is now discouraged, as is the synchronous
shell method, but it may be useful for some methods where waiting
for the outcome of the output is required.
(Important: the `system()` helper is still required when determining
what the preferred terminal is during the initialization of the
`Paths` class.)
This change allows for errors to be thrown during the `asyncExecution`
initial callback, and if one is thrown, allows a `failure` callback to
be used. Existing instances of `waitAndExecute` have been replaced.
I also added the ability to tweak the behaviours of the actions that are
always performed when the asyncExecution method is called: you can now
specify limited behaviours (e.g. only set busy icon). For that use case
I have already created a new method: `asyncWithBusyUI`.
With this change, the handling of the Homebrew Permissions flow has also
been modified: when the user does not get administrative permissions
an error is now thrown which results in an alert being presented to
the user once the error occurs.
There is now an opportunity to further refactor other parts of the app
to more gracefully handle failure states using the Error and
AlertableError protocols.