mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-08-13 04:55:22 +00:00
Respect $NO_COLOR
Fixes #54. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
428fb0045c
commit
c606382a62
2
kubectx
2
kubectx
@ -63,7 +63,7 @@ list_contexts() {
|
||||
cur_ctx_bg=${KUBECTX_CURRENT_BGCOLOR:-$darkbg}
|
||||
|
||||
for c in $(get_contexts); do
|
||||
if [[ -t 1 && "${c}" = "${cur}" ]]; then
|
||||
if [[ -t 1 && -z "${NO_COLOR:-}" && "${c}" = "${cur}" ]]; then
|
||||
echo "${cur_ctx_bg}${cur_ctx_fg}${c}${normal}"
|
||||
else
|
||||
echo "${c}"
|
||||
|
2
kubens
2
kubens
@ -117,7 +117,7 @@ list_namespaces() {
|
||||
cur="$(current_namespace)"
|
||||
ns_list=$(get_namespaces)
|
||||
for c in $ns_list; do
|
||||
if [[ -t 1 && "${c}" = "${cur}" ]]; then
|
||||
if [[ -t 1 && -z "${NO_COLOR:-}" && "${c}" = "${cur}" ]]; then
|
||||
echo "${cur_ctx_bg}${cur_ctx_fg}${c}${normal}"
|
||||
else
|
||||
echo "${c}"
|
||||
|
Loading…
Reference in New Issue
Block a user