1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-18 21:41:57 +00:00

Add a Laravel version segment

This commit is contained in:
Dominik Ritter 2018-05-01 02:10:26 +02:00
parent d9d9fb9b6b
commit a2d8cccd09
4 changed files with 24 additions and 0 deletions

View file

@ -1,3 +1,9 @@
## next
### New Segment: `laravel_version`
Displays the current laravel version.
## v0.6.4 ## v0.6.4
- `load` segment now has configurable averages. - `load` segment now has configurable averages.

View file

@ -120,6 +120,7 @@ The segments that are currently available are:
* `nvm` - Show the version of Node that is currently active, if it differs from the version used by NVM * `nvm` - Show the version of Node that is currently active, if it differs from the version used by NVM
* **PHP Segments:** * **PHP Segments:**
* `php_version` - Show the current PHP version. * `php_version` - Show the current PHP version.
* `laravel_version` - Show the current Laravel version.
* [`symfony2_tests`](#symfony2_tests) - Show a ratio of test classes vs code classes for Symfony2. * [`symfony2_tests`](#symfony2_tests) - Show a ratio of test classes vs code classes for Symfony2.
* `symfony2_version` - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * `symfony2_version` - Show the current Symfony2 version, if you are in a Symfony2-Project dir.
* **Python Segments:** * **Python Segments:**

View file

@ -111,6 +111,7 @@ case $POWERLEVEL9K_MODE in
DATE_ICON $'\uE184' #  DATE_ICON $'\uE184' # 
TIME_ICON $'\uE12E' #  TIME_ICON $'\uE12E' # 
JAVA_ICON $'\U2615' # ☕︎ JAVA_ICON $'\U2615' # ☕︎
LARAVEL_ICON ''
) )
;; ;;
'awesome-fontconfig') 'awesome-fontconfig')
@ -206,6 +207,7 @@ case $POWERLEVEL9K_MODE in
DATE_ICON $'\uF073 ' #  DATE_ICON $'\uF073 ' # 
TIME_ICON $'\uF017 ' #  TIME_ICON $'\uF017 ' # 
JAVA_ICON $'\U2615' # ☕︎ JAVA_ICON $'\U2615' # ☕︎
LARAVEL_ICON ''
) )
;; ;;
'awesome-mapped-fontconfig') 'awesome-mapped-fontconfig')
@ -306,6 +308,7 @@ case $POWERLEVEL9K_MODE in
DATE_ICON $'\uF073 ' #  DATE_ICON $'\uF073 ' # 
TIME_ICON $'\uF017 ' #  TIME_ICON $'\uF017 ' # 
JAVA_ICON $'\U2615' # ☕︎ JAVA_ICON $'\U2615' # ☕︎
LARAVEL_ICON ''
) )
;; ;;
'nerdfont-complete'|'nerdfont-fontconfig') 'nerdfont-complete'|'nerdfont-fontconfig')
@ -402,6 +405,7 @@ case $POWERLEVEL9K_MODE in
DATE_ICON $'\uF073 ' #  DATE_ICON $'\uF073 ' # 
TIME_ICON $'\uF017 ' #  TIME_ICON $'\uF017 ' # 
JAVA_ICON $'\U2615' # ☕︎ JAVA_ICON $'\U2615' # ☕︎
LARAVEL_ICON $'\ue73f ' # 
) )
;; ;;
*) *)
@ -497,6 +501,7 @@ case $POWERLEVEL9K_MODE in
DATE_ICON '' DATE_ICON ''
TIME_ICON '' TIME_ICON ''
JAVA_ICON $'\U2615' # ☕︎ JAVA_ICON $'\U2615' # ☕︎
LARAVEL_ICON ''
) )
;; ;;
esac esac

View file

@ -1109,6 +1109,18 @@ prompt_vpn_ip() {
done done
} }
################################################################
# Segment to display laravel version
prompt_laravel_version() {
local laravel_version="$(php artisan --version 2>/dev/null)"
if [[ -n "${laravel_version}" ]]; then
# Remove unrelevant infos
laravel_version="${laravel_version//Laravel Framework version /}"
"$1_prompt_segment" "$0" "$2" "maroon" "white" "${laravel_version}" 'LARAVEL_ICON'
fi
}
################################################################ ################################################################
# Segment to display load # Segment to display load
set_default POWERLEVEL9K_LOAD_WHICH 5 set_default POWERLEVEL9K_LOAD_WHICH 5