@@ -317,20 +317,20 @@ def get_annotated_compilers(config, cpp_library)
317317 compilers
318318end
319319
320- # Handle existence or nonexistence of custom initialization script -- run it if you have it
320+ # Run custom custom script specified by user.
321321#
322322# This feature is to drive GitHub actions / docker image installation where the container is
323323# in a clean-slate state but needs some way to have custom library versions injected into it.
324324# In this case, the user provided script would fetch a git repo or some other method.
325- def perform_custom_initialization ( )
326- script_path = ENV [ VAR_CUSTOM_INIT_SCRIPT ]
327- script_shell = ENV [ VAR_CUSTOM_INIT_SCRIPT + "_SHELL" ] || "/bin/sh"
328- inform ( "Environment variable #{ VAR_CUSTOM_INIT_SCRIPT } " ) { "'#{ script_path } '" }
325+ def run_custom_script ( env_var )
326+ script_path = ENV [ env_var ]
327+ script_shell = ENV [ env_var + "_SHELL" ] || "/bin/sh"
328+ inform ( "Environment variable #{ env_var } " ) { "'#{ script_path } '" }
329329 return if script_path . nil?
330330 return if script_path . empty?
331331
332332 script_pathname = Pathname . getwd + script_path
333- assure ( "Script at #{ VAR_CUSTOM_INIT_SCRIPT } exists" ) { script_pathname . exist? }
333+ assure ( "Script at #{ env_var } exists" ) { script_pathname . exist? }
334334
335335 assure_multiline ( "Running #{ script_pathname } with #{ script_shell } in libraries working dir" ) do
336336 Dir . chdir ( @backend . lib_dir ) do
@@ -539,7 +539,7 @@ def perform_example_compilation_tests(cpp_library, config)
539539end
540540
541541# run any library init scripts from the library itself.
542- perform_custom_initialization ( )
542+ run_custom_script ( VAR_CUSTOM_INIT_SCRIPT )
543543
544544# initialize library under test
545545inform ( "Environment variable #{ VAR_USE_SUBDIR } " ) { "'#{ ENV [ VAR_USE_SUBDIR ] } '" }
0 commit comments