Skip to content

Commit 501c237

Browse files
committed
improve: prioritize local build_config.rb over default configuration
Add fallback to check for ./build_config.rb before using default.rb
1 parent 54ee911 commit 501c237

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/mruby/build.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ class << self
6060
def mruby_config_path
6161
path = ENV['MRUBY_CONFIG'] || ENV['CONFIG']
6262
if path.nil? || path.empty?
63-
path = "#{MRUBY_ROOT}/build_config/default.rb"
63+
if File.file?("./build_config.rb")
64+
path = "./build_config.rb"
65+
else
66+
path = "#{MRUBY_ROOT}/build_config/default.rb"
67+
end
6468
elsif !File.file?(path) && !Pathname.new(path).absolute?
6569
f = "#{MRUBY_ROOT}/build_config/#{path}.rb"
6670
path = File.exist?(f) ? f : File.extname(path).empty? ? f : path

0 commit comments

Comments
 (0)