Skip to content

Commit

Permalink
Extend run_custom_script to accept arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
hlovdal committed Dec 28, 2022
1 parent e44da15 commit 8599b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exe/arduino_ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def get_annotated_compilers(config, cpp_library)
# This feature is to drive GitHub actions / docker image installation where the container is
# in a clean-slate state but needs some way to have custom library versions injected into it.
# In this case, the user provided script would fetch a git repo or some other method.
def run_custom_script(env_var)
def run_custom_script(env_var, *args)
script_path = ENV[env_var]
script_shell = ENV[env_var + "_SHELL"] || "/bin/sh"
inform("Environment variable #{env_var}") { "'#{script_path}'" }
Expand All @@ -342,7 +342,7 @@ def run_custom_script(env_var)

assure_multiline("Running #{script_pathname} with #{script_shell} in libraries working dir") do
Dir.chdir(@backend.lib_dir) do
IO.popen([script_shell, script_pathname.to_s], err: [:child, :out]) do |io|
IO.popen([script_shell, script_pathname.to_s, *args], err: [:child, :out]) do |io|
io.each_line { |line| puts " #{line}" }
end
end
Expand Down

0 comments on commit 8599b12

Please sign in to comment.