@@ -66,6 +66,8 @@ def self.parse(options)
66
66
puts "Additionally, the following environment variables control the script:"
67
67
puts " - #{ VAR_CUSTOM_INIT_SCRIPT } - if set, this script will be run from the Arduino/libraries directory"
68
68
puts " prior to any automated library installation or testing (e.g. to install unofficial libraries)"
69
+ puts " - #{ VAR_CUSTOM_INIT_SCRIPT } _SHELL - if set, this will override the"
70
+ puts " default shell (/bin/sh) used to execute #{ VAR_CUSTOM_INIT_SCRIPT } with."
69
71
puts " - #{ VAR_USE_SUBDIR } - if set, the script will install the library from this subdirectory of the cwd"
70
72
puts " - #{ VAR_EXPECT_EXAMPLES } - if set, testing will fail if no example sketches are present"
71
73
puts " - #{ VAR_EXPECT_UNITTESTS } - if set, testing will fail if no unit tests are present"
@@ -336,16 +338,17 @@ def get_annotated_compilers(config, cpp_library)
336
338
# In this case, the user provided script would fetch a git repo or some other method.
337
339
def perform_custom_initialization ( )
338
340
script_path = ENV [ VAR_CUSTOM_INIT_SCRIPT ]
341
+ script_shell = ENV [ VAR_CUSTOM_INIT_SCRIPT + "_SHELL" ] || "/bin/sh"
339
342
inform ( "Environment variable #{ VAR_CUSTOM_INIT_SCRIPT } " ) { "'#{ script_path } '" }
340
343
return if script_path . nil?
341
344
return if script_path . empty?
342
345
343
346
script_pathname = Pathname . getwd + script_path
344
347
assure ( "Script at #{ VAR_CUSTOM_INIT_SCRIPT } exists" ) { script_pathname . exist? }
345
348
346
- assure_multiline ( "Running #{ script_pathname } with sh in libraries working dir" ) do
349
+ assure_multiline ( "Running #{ script_pathname } with #{ script_shell } in libraries working dir" ) do
347
350
Dir . chdir ( @backend . lib_dir ) do
348
- IO . popen ( [ "/bin/sh" , script_pathname . to_s ] , err : [ :child , :out ] ) do |io |
351
+ IO . popen ( [ script_shell , script_pathname . to_s ] , err : [ :child , :out ] ) do |io |
349
352
io . each_line { |line | puts " #{ line } " }
350
353
end
351
354
end
0 commit comments