ignore errors from tput (to fix TERM=vt100) (#73)

Currently TERM=vt100 is causing kubectx failure since tput is returning
exitcode=1. vt100 does not have colors. Ignoring tput exit code.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-08-22 09:50:34 -07:00 committed by GitHub
parent e368d13eea
commit 7b23263fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -53,9 +53,9 @@ list_contexts() {
cur="$(current_context)"
local yellow darkbg normal
yellow=$(tput setaf 3)
darkbg=$(tput setab 0)
normal=$(tput sgr0)
yellow=$(tput setaf 3 || true)
darkbg=$(tput setab 0 || true)
normal=$(tput sgr0 || true)
local cur_ctx_fg cur_ctx_bg
cur_ctx_fg=${KUBECTX_CURRENT_FGCOLOR:-$yellow}

6
kubens
View File

@ -104,9 +104,9 @@ set_namespace() {
list_namespaces() {
local yellow darkbg normal
yellow=$(tput setaf 3)
darkbg=$(tput setab 0)
normal=$(tput sgr0)
yellow=$(tput setaf 3 || true)
darkbg=$(tput setab 0 || true)
normal=$(tput sgr0 || true)
local cur_ctx_fg cur_ctx_bg
cur_ctx_fg=${KUBECTX_CURRENT_FGCOLOR:-$yellow}