This patch introduces an internal _KUBECTX_FORCE_COLOR environment variable
that overrides color output decision.
With this, fzf output shows the color indicators for ctx/ns and choosing the
option with the color works without any extra handling.
Fixes#89.
Fixes#98.
On the various flavors of bash for Windows kubectl won't resolve as the binary is kubectl.exe.
Simple aliasing doesn't seem to work. So test for both otherwise fail with a not found error.
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 is previously offered in #18, #22, and #27 and I previously rejected
these PRs. My rationale was to prevent scripting around kubectx as it is
meant to be used as an interactive tool.
But clearly that will be a problem, when you're doing operations like:
kubectx -d $(kubectx)
which I proposed in #39. Plus this change is harmless. I think this
implementation does a better check than the previous ones.
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
BSD coreutils readlink doesn't have -f option, so
adding a Python one-liner feedback to eval symlinks/homedir.
Fixes#8.
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Fixes#1. Now kubectx also ships with kubens.
Extracted utility functions to a utils.bash file, loaded
from ../include/utils.bash.
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>