diff options
author | Brandon Clothier <brandon14125@gmail.com> | 2018-07-18 18:45:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 18:45:05 +0300 |
commit | ef1f29a5cb171c739f0dbf41e6dbfa1fb3558345 (patch) | |
tree | 042d302d5aeab0bbb6eb7adfe192171b71098238 /powerlevel9k.zsh-theme | |
parent | 48b264f564c2322f4932da0d391fa98331ebc158 (diff) |
Drop grep usage in favor of zsh regex test
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 4 |
1 files 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' |