fix: skip local build_config.rb when working in MRUBY_ROOT

Only use local build_config.rb when current directory != MRUBY_ROOT.
This commit is contained in:
buty4649
2025-08-01 14:06:19 +09:00
parent 8e074f185b
commit 7cfbcc3599
+5 -1
View File
@@ -60,7 +60,11 @@ module MRuby
def mruby_config_path
path = ENV['MRUBY_CONFIG'] || ENV['CONFIG']
if path.nil? || path.empty?
path = File.file?("./build_config.rb") ? "./build_config.rb" : "#{MRUBY_ROOT}/build_config/default.rb"
if Dir.pwd != MRUBY_ROOT && File.file?("./build_config.rb")
path = "./build_config.rb"
else
path = "#{MRUBY_ROOT}/build_config/default.rb"
end
elsif !File.file?(path) && !Pathname.new(path).absolute?
f = "#{MRUBY_ROOT}/build_config/#{path}.rb"
path = File.exist?(f) ? f : File.extname(path).empty? ? f : path