aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-07-17 11:27:01 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-07-17 11:36:26 +0300
commit2c135dd631019a251e073a0f4e86267cf12c50c0 (patch)
treea0bf016d43517a886a0e7096be60e133dd119fdd /internal/p10k.zsh
parent942c4cf640866d9655d00a2895548acee3ebf64a (diff)
make terraform_version consistent with other *_version segments (#1487)
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 510bf3c5..6fc78f31 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4888,10 +4888,12 @@ _p9k_prompt_terraform_init() {
}
function prompt_terraform_version() {
- _p9k_cached_cmd 0 '' terraform --version
- [[ $_p9k__ret == (#b)Terraform\ v([[:digit:].]##)* ]]
- local terraform_version=$match[1]
- _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' "tf:$terraform_version"
+ _p9k_cached_cmd 0 '' terraform --version || return
+ local v=${_p9k__ret#Terraform v}
+ (( $#v < $#_p9k__ret )) || return
+ v=${v%%$'\n'*}
+ [[ -n $v ]] || return
+ _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $v
}
_p9k_prompt_terraform_version_init() {