Environment.execute() expands $ variable references recursively
This commit is contained in:
parent
58d7f4edd5
commit
116406c74d
@ -48,7 +48,26 @@ module Rscons
|
||||
end
|
||||
|
||||
def execute(short_desc, command)
|
||||
command = command.flatten
|
||||
expand_varref = proc do |varref|
|
||||
if varref.is_a?(Array)
|
||||
varref.map do |ent|
|
||||
expand_varref.call(ent)
|
||||
end
|
||||
else
|
||||
if varref[0] == '$'
|
||||
varname = varref[1, varref.size]
|
||||
varval = self[varname]
|
||||
if varval
|
||||
expand_varref.call(varval)
|
||||
else
|
||||
raise "Could not find variable #{varname.inspect}"
|
||||
end
|
||||
else
|
||||
varref
|
||||
end
|
||||
end
|
||||
end
|
||||
command = expand_varref.call(command.flatten).flatten
|
||||
if @echo == :command
|
||||
puts command.join(' ')
|
||||
elsif @echo == :short
|
||||
|
Loading…
x
Reference in New Issue
Block a user