Skip to content

Commit

Permalink
fix: --with-short-names not compatible with fzf (#79)
Browse files Browse the repository at this point in the history
When kubectx is installed as kctx, FZF_DEFAULT_COMMAND=kubectx won't work.

Fixes #78.

Signed-off-by: Ahmet Alp Balkan <[email protected]>
  • Loading branch information
ahmetb committed Aug 24, 2018
1 parent 46d5933 commit f01719a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kubectx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
set -eou pipefail
IFS=$'\n\t'

SELF_CMD="$0"
KUBECTX="${HOME}/.kube/kubectx"

usage() {
Expand Down Expand Up @@ -91,7 +92,7 @@ switch_context() {

choose_context_interactive() {
local choice
choice="$(FZF_DEFAULT_COMMAND='kubectx' fzf --ansi || true)"
choice="$(FZF_DEFAULT_COMMAND="${SELF_CMD}" fzf --ansi || true)"
if [[ -z "${choice}" ]]; then
echo 2>&1 "error: you did not choose any of the options"
exit 1
Expand Down
3 changes: 2 additions & 1 deletion kubens
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
set -eou pipefail
IFS=$'\n\t'

SELF_CMD="$0"
KUBENS_DIR="${HOME}/.kube/kubens"

usage() {
Expand Down Expand Up @@ -95,7 +96,7 @@ choose_namespace_interactive() {
fi

local choice
choice="$(FZF_DEFAULT_COMMAND='kubens' fzf --ansi || true)"
choice="$(FZF_DEFAULT_COMMAND="${SELF_CMD}" fzf --ansi || true)"
if [[ -z "${choice}" ]]; then
echo 2>&1 "error: you did not choose any of the options"
exit 1
Expand Down

0 comments on commit f01719a

Please sign in to comment.