summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2018-07-23 21:34:00 +0300
committerGitHub <noreply@github.com>2018-07-23 21:34:00 +0300
commit571a859413866897cf962396f02f65a288f677ac (patch)
treebf4f078c9b76eb69f6a3bf162053a606f540f268 /powerlevel9k.zsh-theme
parente70ce438096acab4c35c91fad1c088fb2dff6ae6 (diff)
parent9739c688942f82893dc2721983986425eb5852c5 (diff)
Merge pull request #912 from brandon14/laravel_pormpt_fix
[Bugfix] Fix error in laravel_version when artisan is not present
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme9
1 files changed, 4 insertions, 5 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 73573a07..0b2287ef 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1130,11 +1130,10 @@ prompt_vpn_ip() {
################################################################
# 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 /}"
-
+ local laravel_version="$(php artisan --version 2> /dev/null)"
+ if [[ -n "${laravel_version}" && "${laravel_version}" =~ "Laravel Framework" ]]; then
+ # Strip out everything but the version
+ laravel_version="${laravel_version//Laravel Framework /}"
"$1_prompt_segment" "$0" "$2" "maroon" "white" "${laravel_version}" 'LARAVEL_ICON'
fi
}