Cleanup sorting method for provisioner sorting
This commit is contained in:
parent
8c39d9bfed
commit
160ee09da2
|
@ -57,6 +57,7 @@ module Vagrant
|
||||||
return pvs
|
return pvs
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# ensure placeholder variables are Arrays
|
||||||
dep_provs = []
|
dep_provs = []
|
||||||
each_provs = []
|
each_provs = []
|
||||||
all_provs = []
|
all_provs = []
|
||||||
|
@ -83,8 +84,6 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add :each and :all provisioners in reverse to preserve order in Vagrantfile
|
# Add :each and :all provisioners in reverse to preserve order in Vagrantfile
|
||||||
|
|
||||||
# add each to final array
|
|
||||||
tmp_final_provs = []
|
tmp_final_provs = []
|
||||||
final_provs.each_with_index.map do |(prv,o), i|
|
final_provs.each_with_index.map do |(prv,o), i|
|
||||||
tmp_before = []
|
tmp_before = []
|
||||||
|
@ -104,16 +103,14 @@ module Vagrant
|
||||||
end
|
end
|
||||||
final_provs = tmp_final_provs
|
final_provs = tmp_final_provs
|
||||||
|
|
||||||
# add all to final array
|
# Add all to final array
|
||||||
tmp_final_provs = final_provs.dup
|
|
||||||
all_provs.reverse_each do |p,options|
|
all_provs.reverse_each do |p,options|
|
||||||
if options[:before]
|
if options[:before]
|
||||||
tmp_final_provs.insert(0, [p,options])
|
final_provs.insert(0, [p,options])
|
||||||
elsif options[:after]
|
elsif options[:after]
|
||||||
tmp_final_provs.push([p,options])
|
final_provs.push([p,options])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
final_provs = tmp_final_provs
|
|
||||||
|
|
||||||
return final_provs
|
return final_provs
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue