Store intermediate resources in reducer so the array is not empty the first run. Addresses #1590
This commit is contained in:
parent
60d88139af
commit
5cab7c46a9
|
@ -211,20 +211,21 @@ module Middleman
|
|||
|
||||
@app.logger.debug '== Rebuilding resource list'
|
||||
|
||||
@resources = @resource_list_manipulators.reduce([]) do |result, (_, inst)|
|
||||
newres = inst.manipulate_resource_list(result)
|
||||
@resources = []
|
||||
|
||||
@resource_list_manipulators.each do |(_, inst)|
|
||||
@resources = inst.manipulate_resource_list(@resources)
|
||||
|
||||
# Reset lookup cache
|
||||
reset_lookup_cache!
|
||||
newres.each do |resource|
|
||||
|
||||
@resources.each do |resource|
|
||||
@_lookup_by_path[resource.path] = resource
|
||||
@_lookup_by_destination_path[resource.destination_path] = resource
|
||||
end
|
||||
|
||||
newres
|
||||
invalidate_resources_not_ignored_cache!
|
||||
end
|
||||
|
||||
invalidate_resources_not_ignored_cache!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue