From 9289af013216fdd3679b15b73b9d78e3af35b9e4 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 12 Dec 2012 21:38:57 -0600 Subject: [PATCH] Don't include `system` in `rbenv versions --bare` output --- libexec/rbenv-versions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rbenv-versions b/libexec/rbenv-versions index a64e8537..346800a3 100755 --- a/libexec/rbenv-versions +++ b/libexec/rbenv-versions @@ -6,10 +6,12 @@ if [ "$1" = "--bare" ]; then hit_prefix="" miss_prefix="" current_version="" + include_system="" else hit_prefix="* " miss_prefix=" " current_version="$(rbenv-version-name || true)" + include_system="1" fi print_version() { @@ -20,8 +22,8 @@ print_version() { fi } -# detect if there is system ruby -if RBENV_VERSION=system rbenv-which ruby >/dev/null 2>&1; then +# Include "system" in the non-bare output, if it exists +if [ -n "$include_system" ] && RBENV_VERSION=system rbenv-which ruby >/dev/null 2>&1; then print_version system fi