lib/kameleon/recipe.rb in kameleon-builder-2.2.3 vs lib/kameleon/recipe.rb in kameleon-builder-2.2.4

- old
+ new

@@ -325,19 +325,12 @@ @global.merge! YAML.load(resolved_global) consistency_check resolve_checkpoint unless @checkpoint.nil? - Kameleon.ui.info("Resolving variables") @sections.values.each do |section| section.macrosteps.each do |macrostep| - macrostep.resolve_variables!(@global) - end - end - - @sections.values.each do |section| - section.macrosteps.each do |macrostep| # First pass : resolve aliases Kameleon.ui.debug("Resolving aliases for macrostep '#{macrostep.name}'") macrostep.microsteps.each do |microstep| microstep.commands.map! do |cmd| # resolve alias @@ -345,9 +338,21 @@ end end # flatten for multiple-command alias + variables Kameleon.ui.debug("Resolving check statements for macrostep '#{macrostep.name}'") macrostep.microsteps.each { |microstep| microstep.commands.flatten! } + end + end + + Kameleon.ui.info("Resolving variables") + @sections.values.each do |section| + section.macrosteps.each do |macrostep| + macrostep.resolve_variables!(@global) + end + end + + @sections.values.each do |section| + section.macrosteps.each do |macrostep| # Second pass : resolve variables + clean/init hooks macrostep.microsteps.each do |microstep| microstep.commands.map! do |cmd| resolve_hooks(cmd, macrostep, microstep) end