summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-05-02 18:18:15 +0200
committerUlrich Müller <ulm@gentoo.org>2024-05-02 18:18:15 +0200
commit455a245dd327a8f18f77986662214206aa50d490 (patch)
tree83f65f4c03d01d36d25fff34375eba6b99e79992
parentPass --usepkg=n to Portage (diff)
downloademacs-tools-455a245dd327a8f18f77986662214206aa50d490.tar.gz
emacs-tools-455a245dd327a8f18f77986662214206aa50d490.tar.bz2
emacs-tools-455a245dd327a8f18f77986662214206aa50d490.zip
Respect NO_COLOR
* emacs-updater (COLOUR): Respect the NO_COLOR environment variable. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog5
-rwxr-xr-xemacs-updater6
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 <ulm@gentoo.org>
+
+ * emacs-updater (COLOUR): Respect the NO_COLOR environment
+ variable.
+
2024-05-01 Arsen Arsenović <arsen@gentoo.org>
* 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]...