diff --git a/bin/list-all b/bin/list-all index cea6e3d1133524d55a7d3ff5201e18741ba66564..958ec5b45937c9ac222a51ce3270a2918405f492 100755 --- a/bin/list-all +++ b/bin/list-all @@ -10,7 +10,7 @@ list_versions() { # This sed command was a quick and dirty solution to remove topaz-dev from # the version list, since it doesn't exist - "$(ruby_build_path)" --definitions | paste -sd " " - | sed "s|topaz-dev||g" + "$(ruby_build_path)" --definitions | grep -v "topaz-dev" | paste -sd " " - } -list_versions +list_versions 2> /dev/null diff --git a/lib/utils.sh b/lib/utils.sh index a273b57d186ecff724e475bcb79f229db385328c..545eb66f8128771e40ba7c2fcdd5f9d519deb50a 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -29,21 +29,24 @@ ensure_ruby_build_installed() { download_ruby_build() { # Print to stderr so asdf doesn't assume this string is a list of versions echo "Downloading ruby-build..." >&2 - local build_dir="ruby-build-source" + local build_dir="$(asdf_ruby_plugin_path)/ruby-build-source" # Clone down and checkout the correct ruby-build version git clone https://github.com/rbenv/ruby-build.git $build_dir >&2 >/dev/null (cd $build_dir; git checkout $RUBY_BUILD_TAG >&2 >/dev/null) # Install in the ruby-build dir - PREFIX="$(ruby_build_dir)" ./$build_dir/install.sh + PREFIX="$(ruby_build_dir)" $build_dir/install.sh # Remove ruby-build source dir rm -rf $build_dir } +asdf_ruby_plugin_path() { + echo "$(dirname "$(dirname "$0")")" +} ruby_build_dir() { - echo "$(dirname "$(dirname "$0")")/ruby-build" + echo "$(asdf_ruby_plugin_path)/ruby-build" } ruby_build_path() { echo "$(ruby_build_dir)/bin/ruby-build"