@@ -331,20 +331,20 @@ def get_annotated_compilers(config, cpp_library)
331
331
compilers
332
332
end
333
333
334
- # Handle existence or nonexistence of custom initialization script -- run it if you have it
334
+ # Run custom custom script specified by user.
335
335
#
336
336
# This feature is to drive GitHub actions / docker image installation where the container is
337
337
# in a clean-slate state but needs some way to have custom library versions injected into it.
338
338
# In this case, the user provided script would fetch a git repo or some other method.
339
- def perform_custom_initialization ( )
340
- script_path = ENV [ VAR_CUSTOM_INIT_SCRIPT ]
341
- script_shell = ENV [ VAR_CUSTOM_INIT_SCRIPT + "_SHELL" ] || "/bin/sh"
342
- inform ( "Environment variable #{ VAR_CUSTOM_INIT_SCRIPT } " ) { "'#{ script_path } '" }
339
+ def run_custom_script ( env_var )
340
+ script_path = ENV [ env_var ]
341
+ script_shell = ENV [ env_var + "_SHELL" ] || "/bin/sh"
342
+ inform ( "Environment variable #{ env_var } " ) { "'#{ script_path } '" }
343
343
return if script_path . nil?
344
344
return if script_path . empty?
345
345
346
346
script_pathname = Pathname . getwd + script_path
347
- assure ( "Script at #{ VAR_CUSTOM_INIT_SCRIPT } exists" ) { script_pathname . exist? }
347
+ assure ( "Script at #{ env_var } exists" ) { script_pathname . exist? }
348
348
349
349
assure_multiline ( "Running #{ script_pathname } with #{ script_shell } in libraries working dir" ) do
350
350
Dir . chdir ( @backend . lib_dir ) do
@@ -570,7 +570,7 @@ def perform_example_compilation_tests(cpp_library, config)
570
570
end
571
571
572
572
# run any library init scripts from the library itself.
573
- perform_custom_initialization ( )
573
+ run_custom_script ( VAR_CUSTOM_INIT_SCRIPT )
574
574
575
575
# initialize library under test
576
576
inform ( "Environment variable #{ VAR_USE_SUBDIR } " ) { "'#{ ENV [ VAR_USE_SUBDIR ] } '" }
0 commit comments