-
Notifications
You must be signed in to change notification settings - Fork 7
Color Writer: NO_COLOR support #8
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Once this lands in juju we might want to reach out to the no-color.org folks and add juju to the list.
The following supports the NO_COLOR standard. The idea is that we don't write color to the term if the env var of NO_COLOR is set. The spec states: > Command-line software which adds ANSI color to its output by default should check for the presence of a NO_COLOR environment variable that, when present (regardless of its value), prevents the addition of ANSI color.
361dba5
to
71a40d6
Compare
file, err := ioutil.TempFile("", "") | ||
c.Assert(err, gc.IsNil) | ||
|
||
os.Setenv("NO_COLOR", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be deferring something to restore NO_COLOR to its original value? Otherwise parts of the test suite will be running in a different context than the rest.
!!build!! |
4 similar comments
!!build!! |
!!build!! |
!!build!! |
!!build!! |
Build finished. |
|
Build finished. |
!!build!! |
Build finished. |
|
Build finished. |
1 similar comment
Build finished. |
|
The following supports the NO_COLOR standard. The idea is that we don't
write color to the term if the env var of NO_COLOR is set to anything
that can be truthy.
This brings juju inline with more new CLI.
See: https://no-color.org/