mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 17:46:21 +00:00
tener en cuenta todos los directorios posibles
por ejemplo DeployLocalizedDomain en la otra rama tiene otras rutas
This commit is contained in:
parent
23260791e4
commit
cc839affb8
1 changed files with 16 additions and 8 deletions
|
@ -115,11 +115,17 @@ class UriCollectionJob < PeriodicJob
|
|||
STAT_NAME
|
||||
end
|
||||
|
||||
# Obtiene todas las ubicaciones de archivos
|
||||
#
|
||||
# @return [String]
|
||||
#
|
||||
# TODO: Cambiar al mergear origin-referer
|
||||
def destination
|
||||
@destination ||= site.deploys.find_by(type: 'DeployLocal').destination
|
||||
def destinations
|
||||
@destinations ||= site.deploys.map(&:destination).select do |d|
|
||||
File.directory?(d)
|
||||
end.map do |d|
|
||||
File.realpath(d)
|
||||
end.uniq
|
||||
end
|
||||
|
||||
# Recolecta todas las URIs menos imágenes
|
||||
|
@ -127,14 +133,16 @@ class UriCollectionJob < PeriodicJob
|
|||
# @return [Array]
|
||||
def uris
|
||||
@uris ||=
|
||||
locales.map do |locale|
|
||||
uri = "/#{locale}/".squeeze('/')
|
||||
dir = File.join(destination, locale)
|
||||
destinations.map do |destination|
|
||||
locales.map do |locale|
|
||||
uri = "/#{locale}/".squeeze('/')
|
||||
dir = File.join(destination, locale)
|
||||
|
||||
files(dir).map do |f|
|
||||
uri + f
|
||||
files(dir).map do |f|
|
||||
uri + f
|
||||
end
|
||||
end
|
||||
end.flatten(2)
|
||||
end.flatten(3)
|
||||
end
|
||||
|
||||
# @return [Array]
|
||||
|
|
Loading…
Reference in a new issue