From ef1f29a5cb171c739f0dbf41e6dbfa1fb3558345 Mon Sep 17 00:00:00 2001 From: Brandon Clothier Date: Wed, 18 Jul 2018 11:45:05 -0400 Subject: [PATCH] Drop grep usage in favor of zsh regex test --- powerlevel9k.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 6a2f0f5f..573f2f68 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1118,8 +1118,8 @@ prompt_vpn_ip() { ################################################################ # Segment to display laravel version prompt_laravel_version() { - local laravel_version="$(php artisan --version 2>&1 | grep -oe '^Laravel Framework [0-9.]*')" - if [[ -n "${laravel_version}" ]]; then + 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'