commit:     455a245dd327a8f18f77986662214206aa50d490
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May  2 16:18:15 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu May  2 16:18:15 2024 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=455a245d

Respect NO_COLOR

* emacs-updater (COLOUR): Respect the NO_COLOR environment
variable.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog     | 5 +++++
 emacs-updater | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2dc5440..6323e0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-05-02  Ulrich Müller  <[email protected]>
+
+       * emacs-updater (COLOUR): Respect the NO_COLOR environment
+       variable.
+
 2024-05-01  Arsen Arsenović  <[email protected]>
 
        * emacs-updater (pm_portage): Pass --usepkg=n to Portage.

diff --git a/emacs-updater b/emacs-updater
index c1ac43e..34fd89b 100755
--- a/emacs-updater
+++ b/emacs-updater
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2007-2023 Gentoo Authors
+# Copyright 2007-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2 or later
 
 # Authors:
@@ -20,12 +20,14 @@ PM_EXTRAOPTS=( )
 
 # Other default variable settings
 BATCH=
-COLOUR=
 EXACT=
 MAJOR=
 ORPHANS=
 PRETEND=
 
+# Check for NO_COLOR environment variable: https://no-color.org/
+COLOUR=${NO_COLOR:+no}
+
 usage() {
     sed -e 's/^X//' <<-EOF
        Usage: ${0##*/} [OPTION]...

Reply via email to