aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-22 09:32:06 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-22 09:32:06 +0300
commit0b8a9bded5ef7ba71f2b2a329b8916cd92f2f08c (patch)
treebe521bc26a7f321e19e3273ad1d218fc33a3bb2b /powerlevel9k.zsh-theme
parent0eef01d97f9ee38aadcd16d361a6866b1f004103 (diff)
speed up symfony2_version prompt
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme7
1 files changed, 3 insertions, 4 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index c7bec43b..853576d6 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1540,10 +1540,9 @@ prompt_symfony2_tests() {
################################################################
# Segment to display Symfony2-Version
prompt_symfony2_version() {
- if [[ -f app/bootstrap.php.cache ]]; then
- local symfony2_version
- symfony2_version=$(grep " VERSION " app/bootstrap.php.cache | sed -e 's/[^.0-9]*//g')
- "$1_prompt_segment" "$0" "$2" "grey35" "$DEFAULT_COLOR" 'SYMFONY_ICON' 0 '' "${symfony2_version//\%/%%}"
+ if [[ -r app/bootstrap.php.cache ]]; then
+ local v="${$(command grep -F " VERSION " app/bootstrap.php.cache 2>/dev/null)//[![:digit:].]}"
+ "$1_prompt_segment" "$0" "$2" "grey35" "$DEFAULT_COLOR" 'SYMFONY_ICON' 0 '' "${v//\%/%%}"
fi
}