forego
forego copied to clipboard
Add NO_COLOR, inject version tag, and more
This PR is a rebased version of #122 with a couple more commits added by me. That original PR improves the error handling and adds automatic disabling of color output based on whether stdout is a terminal.
This PR expands on that with a few more commits to:
- Add injecting a VERSION Makefile variable so you can include the date / commit in the resulting build. Defaults to current value of "dev":
$ make VERSION="$(date --utc +%Y%m%d-%H%M%S)-$(git show-ref -s -- HEAD)" build
...
$ forego version
20200605-120321-0bdbf9b27cf9da13e246ff1ba90ab5961f4be849
- Checks for a NO_COLOR env variable and, if defined, disables color output regardless of whether we're running in a terminal (per https://no-color.org/)
$ NO_COLOR=1 forego start
...
- Optimize things a bit by only creating the "left" outlet formatter once. Previously it was being generated for ever line of output but the format itself never changes so it's wasted cycles.
Hi there 👋
There seems to be quite a lot of requests for supporting a "no color" output (including from me 😄), I think merging this in would be a "quick win".
@ddollar Could this be reviewed? Apologies, if you're not maintaining this repo anymore, but if that is the case could you point me to who is maintaining the repo?
Thank you.
@sehrope, nice work. I've closed my pull request, hopefully someone will merge this in soon.
Regards, iain
@yb66 @oliver-hohn
As there hasn't been any activity in this repo in a while, I'm publishing the changes in my fork at: https://github.com/sehrope/forego
It includes everything from this PR as well as some updates to the go version, changes to use go modules, GitHub Actions for CI, and has pre-built binaries as GitHub releases for Linux, OSX, and Windows (https://github.com/sehrope/forego/releases).
If things every open up again here we can merge back.