Open darkvertex opened 3 years ago
When the command exists but kubernetes has no context currently configured, kubectl config current-context prints error: current-context is not set into the stderr.
kubectl config current-context
error: current-context is not set
It's annoying and can be bypassed by disabling the Kubernetes segment temporarily HOWEVER I think it may be worth fixing here: https://github.com/chris-marsh/pureline/blob/main/segments/kubernetes_segment#L12 and changing it for:
local context=$(kubectl config current-context 2>/dev/null)
to silence the stderr (because you have the exit code and stdout will be empty when not set, so it's superfluous.)
Thanks for the report and fix. I'll include it soon.
When the command exists but kubernetes has no context currently configured,
kubectl config current-context
printserror: current-context is not set
into the stderr.It's annoying and can be bypassed by disabling the Kubernetes segment temporarily HOWEVER I think it may be worth fixing here: https://github.com/chris-marsh/pureline/blob/main/segments/kubernetes_segment#L12 and changing it for:
to silence the stderr (because you have the exit code and stdout will be empty when not set, so it's superfluous.)