From 58f70e57e65097e73604e35b8e8334a8e34afbee Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Sat, 5 Jan 2019 02:29:05 +0530 Subject: [PATCH] rvm: Use @natemccurdy review suggestions --- powerlevel9k.zsh-theme | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index bed5b9cc..fc8c4703 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1365,10 +1365,12 @@ prompt_rspec_stats() { ################################################################ # Segment to display Ruby Version Manager information prompt_rvm() { - local version_and_gemset=${$(rvm-prompt v p)/ruby-} + if [ $commands[rvm-prompt] ]; then + local version_and_gemset=${$(rvm-prompt v p)/ruby-} - if [[ -n "$version_and_gemset" ]]; then - "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON' + if [[ -n "$version_and_gemset" ]]; then + "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON' + fi fi }