Skip to content

Commit b29d195

Browse files
authored
Respect "RUBIES_DIR" environment variable (#312)
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
1 parent 36c6d1e commit b29d195

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

run_benchmarks.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
332332
name = name.shellsplit.first
333333
end
334334
version, *options = version.shellsplit
335-
unless executable = ["/opt/rubies/#{version}/bin/ruby", "#{ENV["HOME"]}/.rubies/#{version}/bin/ruby"].find { |path| File.executable?(path) }
336-
abort "Cannot find '#{version}' in /opt/rubies or ~/.rubies"
335+
rubies_dir = ENV["RUBIES_DIR"] || "#{ENV["HOME"]}/.rubies"
336+
unless executable = ["/opt/rubies/#{version}/bin/ruby", "#{rubies_dir}/#{version}/bin/ruby"].find { |path| File.executable?(path) }
337+
abort "Cannot find '#{version}' in /opt/rubies or #{rubies_dir}"
337338
end
338339
args.executables[name] = [executable, *options]
339340
end

0 commit comments

Comments
 (0)