From 7b23263fc247ce0cb12cda194b772c98056d75d0 Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Wed, 22 Aug 2018 09:50:34 -0700 Subject: [PATCH] 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 --- kubectx | 6 +++--- kubens | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kubectx b/kubectx index 8d62317..3eb813b 100755 --- a/kubectx +++ b/kubectx @@ -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} diff --git a/kubens b/kubens index 0eb21b2..b57a85e 100755 --- a/kubens +++ b/kubens @@ -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}