nix/modules/home-manager/scripts/common/bin/kubfc
2023-10-05 13:43:28 -05:00

9 lines
206 B
Bash
Executable file

#!/usr/bin/env sh
kubectl config get-contexts --no-headers | \
uniq | \
sort | \
tr -s ' ' | \
sed -E 's/^\*?[[:space:]]*//g' | \
cut -d ' ' -f1 | \
sk | \
xargs -I{} kubectl config use-context '{}'