diff options
author | Alejandro Gandara <alex@alexgan.net> | 2021-07-16 22:39:23 +0300 |
---|---|---|
committer | Alejandro Gandara <alex@alexgan.net> | 2021-07-16 22:39:23 +0300 |
commit | dae5f7f1c9ef5116b046f1f9b31a9bdf2154e76b (patch) | |
tree | 6d7f7dcbac927cd6451428df1843a7da18058996 /internal/p10k.zsh | |
parent | 9f98915167b35bc045090c106b8249f6dadfaf01 (diff) |
* Added cache to terraform --version
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r-- | internal/p10k.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 07cc280a..510bf3c5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4888,8 +4888,10 @@ _p9k_prompt_terraform_init() { } function prompt_terraform_version() { - local terraform_version="$(command terraform --version)" - _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' $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_prompt_terraform_version_init() { |