mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-17 02:00:07 +00:00
use consisent patterns when parsing yaml
This commit is contained in:
parent
05deaa802f
commit
f337616738
1 changed files with 1 additions and 1 deletions
|
@ -2897,7 +2897,7 @@ prompt_kubecontext() {
|
||||||
local context cluster namespace
|
local context cluster namespace
|
||||||
() {
|
() {
|
||||||
local cfg && cfg=(${(f)"$(kubectl config view -o=yaml 2>/dev/null)"}) || return
|
local cfg && cfg=(${(f)"$(kubectl config view -o=yaml 2>/dev/null)"}) || return
|
||||||
local ctx=(${(@M)cfg:#current-context: [^\"\'|>]*})
|
local ctx=(${(@M)cfg:#current-context: [^\"\'\|\>]*})
|
||||||
(( $#ctx == 1 )) || return
|
(( $#ctx == 1 )) || return
|
||||||
context=${ctx[1]#current-context: }
|
context=${ctx[1]#current-context: }
|
||||||
local -i pos=${cfg[(i)contexts:]}
|
local -i pos=${cfg[(i)contexts:]}
|
||||||
|
|
Loading…
Reference in a new issue