Rework adsf a bit for performance.

Add a comment re: adsf provenance format caveat.

See #119
This commit is contained in:
Justin Hileman 2017-12-24 11:28:38 -08:00
parent 753189f173
commit 7d6c23e1dd

View File

@ -604,14 +604,13 @@ function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
else if type -q chruby else if type -q chruby
set ruby_version $RUBY_VERSION set ruby_version $RUBY_VERSION
else if type -q asdf else if type -q asdf
set -l asdf_ruby_version_str (asdf current ruby ^ /dev/null) set -l asdf_current_ruby (asdf current ruby ^/dev/null); or return
if test $status -eq 0 read -l asdf_ruby_version asdf_provenance -- $asdf_current_ruby
set -l asdf_system_origin "(set by $HOME/.tool-versions)"
set -l asdf_current_version_provenance (string split -m 1 ' ' $asdf_ruby_version_str)[2]
set ruby_version (string split -m 1 ' ' $asdf_ruby_version_str)[1]
[ "$asdf_current_version_provenance" = "$asdf_system_origin" ]; and return # If asdf changes their ruby version provenance format, update this to match
end [ "$asdf_provenance" = "(set by $HOME/.tool-versions)" ]; and return
set ruby_version $asdf_ruby_version
end end
[ -z "$ruby_version" ]; and return [ -z "$ruby_version" ]; and return
__bobthefish_start_segment $__color_rvm __bobthefish_start_segment $__color_rvm