mirror of
https://gitlab.com/khumba/nvd.git
synced 2024-11-10 06:59:29 +01:00
Respect the NO_COLOR environment variable to disable colour.
This commit is contained in:
parent
19a6f7d3d1
commit
1276c2d3eb
2 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
## 0.2.4 (unreleased)
|
## 0.2.4 (unreleased)
|
||||||
|
|
||||||
|
- Respect the `NO_COLOR` environment variable and disable colour when it is set
|
||||||
|
and nonempty (when the default `--color=auto` is used). For more info see:
|
||||||
|
https://no-color.org
|
||||||
|
|
||||||
## 0.2.3 (2023-05-22)
|
## 0.2.3 (2023-05-22)
|
||||||
|
|
||||||
- Fix compatibility with nix-2.3 where `nix --extra-experimental-features` isn't
|
- Fix compatibility with nix-2.3 where `nix --extra-experimental-features` isn't
|
||||||
|
|
4
src/nvd
4
src/nvd
|
@ -764,7 +764,9 @@ def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
action = args.action
|
action = args.action
|
||||||
NIX_BIN_DIR = args.nix_bin_dir or None
|
NIX_BIN_DIR = args.nix_bin_dir or None
|
||||||
USE_COLOUR = args.color == "always" or (args.color == "auto" and sys.stdout.isatty())
|
USE_COLOUR = \
|
||||||
|
args.color == "always" \
|
||||||
|
or (args.color == "auto" and sys.stdout.isatty() and not os.getenv('NO_COLOR'))
|
||||||
del args.action
|
del args.action
|
||||||
del args.nix_bin_dir
|
del args.nix_bin_dir
|
||||||
del args.color
|
del args.color
|
||||||
|
|
Loading…
Reference in a new issue