mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-26 09:42:51 +03:00
Feature: Truncate kubectl context using variables
Requires the following variables to be defined.
Example variable definition:
set -x tide_kubectl_truncation_strategy l
set -x tide_kubectl_truncation_length 31
Same approach as in:
447945d2cf/functions/_tide_item_git.fish (L2)
This commit is contained in:
parent
447945d2cf
commit
c218a4a945
@ -1,4 +1,4 @@
|
|||||||
function _tide_item_kubectl
|
function _tide_item_kubectl
|
||||||
kubectl config view --minify --output 'jsonpath={.current-context}/{..namespace}' 2>/dev/null | read -l context &&
|
kubectl config view --minify --output 'jsonpath={.current-context}/{..namespace}' 2>/dev/null | string shorten -"$tide_kubectl_truncation_strategy"m"$tide_kubectl_truncation_length" | read -l context &&
|
||||||
_tide_print_item kubectl $tide_kubectl_icon' ' (string replace -r '/(|default)$' '' $context)
|
_tide_print_item kubectl $tide_kubectl_icon' ' (string replace -r '/(|default)$' '' $context)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user