Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NO_COLOR, inject version tag, and more #124

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sehrope
Copy link

@sehrope sehrope commented Jun 5, 2020

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:

  1. 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
  1. 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
...
  1. 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.

schwarz-b5c and others added 9 commits April 2, 2020 10:29
There are plenty of environments without BASH, but with sh.
These could have caused problems: $!"\
- exit if directory doesn't exist
- source .profile only if it exists
- don't suppress stderr while doing that
Injects Makefile arg VERSION into main.Version with default value of "dev".
The output padding is based upon the longest name of processes and thus never
changes at runtime so we can optimize things a bit by only creating the output
formatter pattern once at startup.
@oliver-hohn
Copy link

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.

@yb66
Copy link

yb66 commented Oct 15, 2020

@sehrope, nice work. I've closed my pull request, hopefully someone will merge this in soon.

Regards,
iain

@sehrope
Copy link
Author

sehrope commented Jun 10, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants