aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBrandon Clothier <brandon14125@gmail.com>2018-07-15 01:24:10 +0300
committerBrandon Clothier <brandon14125@gmail.com>2018-07-15 01:24:10 +0300
commit48b264f564c2322f4932da0d391fa98331ebc158 (patch)
tree7c91d9466de3970a9f3b0c914aac9afc7dd73e2b /powerlevel9k.zsh-theme
parenta7b3f310d3c1e5306332dd15401efb9631c76bed (diff)
Fix error in laravel_version when artisan is not present
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 f3126b81..6a2f0f5f 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1118,11 +1118,10 @@ prompt_vpn_ip() {
################################################################
# Segment to display laravel version
prompt_laravel_version() {
- local laravel_version="$(php artisan --version 2>/dev/null)"
+ local laravel_version="$(php artisan --version 2>&1 | grep -oe '^Laravel Framework [0-9.]*')"
if [[ -n "${laravel_version}" ]]; then
- # Remove unrelevant infos
- laravel_version="${laravel_version//Laravel Framework version /}"
-
+ # Strip out everything but the version
+ laravel_version="${laravel_version//Laravel Framework /}"
"$1_prompt_segment" "$0" "$2" "maroon" "white" "${laravel_version}" 'LARAVEL_ICON'
fi
}