- Raise `CaskError` instead of `Plist::ParseError` from module
- Improve error message when parse result is empty
- remove leading garbage text and emit it to stderr (seen in #5060)
- remove trailing garbage text and emit it to stderr (seen in #4819)
This has the incidental effect of emitting DMG licenses during
installation, which seems desirable as permanent functionality.
If not permanent, the warnings to STDERR should still be kept
temporarily to help get better bug reports on `hdiutil`.
A bug wrt DMG licenses must have been introduced in one of
#4892, #4887, #4889, #4900, #4975, #4978, or #4857. Presumably,
the cause is that STDERR was previously silenced when running
`hdiutil`. It would be cleaner (and more reliable) to redirect
STDERR and examine it separately, rather than clean up the
merged outputs.
closes#4819closes#5060
Covering all cases
- external commands as executables
- external commands as Ruby libraries
- built-in command verbs
This is intended as a development aid.
A side benefit is that an external command can be constructed
to use a `run` method, rather than having to accomplish everything
at `require` time.
- based on abstract class `Cask::CLI::InternalUseBase`
- interal-use class file names follow `internal_<verb>.rb`, but the "internal" is dropped for the CLI
- internal-use verbs start with underscore at CLI
- internal-use verbs are invisible in the usage document
As parameter to the `run` method, but also exposed as interface to Cask authors
in eg `uninstall` `:script`. The existing DSL design: `:stderr => :silence`
is more flexible/extensible.
References: #4688
nstead, determine success by directly testing the intended effect:
does the mount path still exist?
Also:
- retry once on failure.
- silent success if the given mount point did not exist.
These changes are intended to help with unpredictable problems with
the test suite that manifest frequently on Travis.
References: #4975, #4900, #4857
Because backtick has a different meaning in the shell, and the user
may copy-and-paste such text.
Some light re-wording included as well, and a reference to "brew cask edit"
changed to "brew cask cat" for simplicity.
Mysterious `hdiutil` errors are a longtime problem with the
test suite, and the largest cause of false Travis failure
reports.
What appears to happen is that `hdiutil` returns a valid
plist output, but also exits with an error code.
Recently, user errors have been reported which seem to be
related to the same problem (#4857).
After #4892 and #4887, we have have more assurances that mount errors
will be caught elsewhere, if the XML is incorrect/missing, or if the
mounts are not returned.
So, for this special case, it should be safe to simply
ignore the error code from `hdiutil`.