mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-08 11:58:51 +00:00
Wrap context names in single quotes to prevent completion script to fail (#316)
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
local KUBECTX="${HOME}/.kube/kubectx"
|
||||
PREV=""
|
||||
|
||||
local all_contexts="$(kubectl config get-contexts --output='name')"
|
||||
local context_array=("${(@f)$(kubectl config get-contexts --output='name')}")
|
||||
local all_contexts=(\'${^context_array}\')
|
||||
|
||||
if [ -f "$KUBECTX" ]; then
|
||||
# show '-' only if there's a saved previous context
|
||||
local PREV=$(cat "${KUBECTX}")
|
||||
|
Reference in New Issue
Block a user