Better ruby segment output when adsf is installed but not configured.

Previously it would add `No` as the ruby version, which was factually correct but not at all what we were looking for. This omits the ruby segment entirely if the adsf plugin for ruby is not installed, or if there is no current ruby version specified.
pull/230/merge
Justin Hileman 4 years ago
parent 7c2d90152e
commit 1f24d5f217

@ -777,9 +777,11 @@ function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
else if type -q chruby # chruby is implemented as a function, so omitting the -f is intentional
set ruby_version $RUBY_VERSION
else if type -fq asdf
asdf current ruby 2>/dev/null | read -l asdf_ruby_version asdf_provenance
set -l asdf_current_ruby (asdf current ruby 2>/dev/null)
or return
echo "$asdf_current_ruby" | read -l asdf_ruby_version asdf_provenance
# If asdf changes their ruby version provenance format, update this to match
[ (string trim -- "$asdf_provenance") = "(set by $HOME/.tool-versions)" ]
and return

Loading…
Cancel
Save