1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-12 08:10:07 +00:00

speed up symfony2_version prompt

This commit is contained in:
romkatv 2019-05-22 08:32:06 +02:00
parent 0eef01d97f
commit 0b8a9bded5

View file

@ -1540,10 +1540,9 @@ prompt_symfony2_tests() {
################################################################ ################################################################
# Segment to display Symfony2-Version # Segment to display Symfony2-Version
prompt_symfony2_version() { prompt_symfony2_version() {
if [[ -f app/bootstrap.php.cache ]]; then if [[ -r app/bootstrap.php.cache ]]; then
local symfony2_version local v="${$(command grep -F " VERSION " app/bootstrap.php.cache 2>/dev/null)//[![:digit:].]}"
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 '' "${v//\%/%%}"
"$1_prompt_segment" "$0" "$2" "grey35" "$DEFAULT_COLOR" 'SYMFONY_ICON' 0 '' "${symfony2_version//\%/%%}"
fi fi
} }