This indirectly also updates the chroma syntax highlighting package,
which fixes a rendering bug for CRLF line endings, which we
encountered in cli. We can therefore remove our internal work-around.
Turns out the "standard" way of wrapping errors in Go is via
`fmt.Errorf("%w")`, which doesn't require an external package and also allows a
finer control of error sentence formatting.
This commit inlines https://github.com/tj/go-termd for a few reasons:
- off the shelf it relies on a broken, erroneously released version of
blackfriday (a markdown parser)
- based on discussion with ampinsk, there are some tweaks we'd like to
make to markdown rendering beyond what the library exposes now
- it's a small library (around 300 sloc)
This commit only:
- messes with go.mod to fix the blackfriday issues
- adds an inclusion note
- renames the package
- Only report an update available if the version number of the release
is greater than the current version
- Removes `command` dependency from `update` package; instead, pass
current version as an argument
- Remove `brew upgrade` instructions since we can't be certain that gh
was installed via Homebrew in the first place.
- Does not check for updates unless stderr is a tty
- Preserve stderr color output even if stdout is not a tty
- Fixes stderr color output on Windows