diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 7200201..1b469e6 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -15,7 +15,7 @@ alias \ # Kubernetes things alias \ - ctx="kubectl ctx" \ + cx="kubectl ctx" \ f='flux' \ h='helm' \ k='kubectl' \ diff --git a/.local/bin/cx b/.local/bin/cx deleted file mode 100755 index 3894856..0000000 --- a/.local/bin/cx +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# cx - Kubernetes context switcher - -LAST=/tmp/last_kube_context -CURR="$(kubectl config current-context)" -[[ -z "$1" ]] && kubectl config get-contexts && exit -[ ! -f $LAST ] && echo "$CURR" >$LAST -[[ "$1" == "-" ]] && USE="$(cat $LAST)" || USE="$1" -[[ "$CURR" != "$USE" ]] && echo "$CURR" >$LAST -kubectl config use-context "$USE"