From 079a8e4c4136b48f07c292920fb5b17310d80958 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Jul 2024 10:27:03 -0700 Subject: [PATCH] Respect "RUBIES_DIR" environment variable I don't use the default chruby installation directory, instead I set the RUBIES_DIR environment variable to change the installation directory. We should respect this env var when trying to locate installed rubies --- run_benchmarks.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run_benchmarks.rb b/run_benchmarks.rb index 29ff80a0..020b2635 100755 --- a/run_benchmarks.rb +++ b/run_benchmarks.rb @@ -332,8 +332,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat name = name.shellsplit.first end version, *options = version.shellsplit - unless executable = ["/opt/rubies/#{version}/bin/ruby", "#{ENV["HOME"]}/.rubies/#{version}/bin/ruby"].find { |path| File.executable?(path) } - abort "Cannot find '#{version}' in /opt/rubies or ~/.rubies" + rubies_dir = ENV["RUBIES_DIR"] || "#{ENV["HOME"]}/.rubies" + unless executable = ["/opt/rubies/#{version}/bin/ruby", "#{rubies_dir}/#{version}/bin/ruby"].find { |path| File.executable?(path) } + abort "Cannot find '#{version}' in /opt/rubies or #{rubies_dir}" end args.executables[name] = [executable, *options] end