5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-28 16:06:21 +00:00

Merge branch 'issue-16282' into production.panel.sutty.nl

This commit is contained in:
f 2024-05-15 17:28:36 -03:00
commit 707bb43f46
No known key found for this signature in database

View file

@ -573,21 +573,34 @@ class Site < ApplicationRecord
# * El archivo Gemfile.lock se modificó # * El archivo Gemfile.lock se modificó
def install_gems def install_gems
return unless persisted? return unless persisted?
return unless (!gems_installed? || theme_path.blank?) || gemfile_updated? || gemfile_lock_updated?
Site.one_at_a_time.synchronize do deploys.find_by_type('DeployLocal').bundle
deploy_local = deploys.find_by_type('DeployLocal') touch
deploy_local.git_lfs FileUtils.touch(gemfile_path)
end
return unless !gems_installed? || gemfile_updated? || gemfile_lock_updated?
Site.one_at_a_time.synchronize do
deploy_local.bundle
touch
FileUtils.touch(gemfile_path)
end
end end
# El sitio tiene una plantilla
#
# @return [Bool]
def theme?
config.key?('theme')
end
# El directorio donde se encuentran los archivos de la plantilla. Si
# es nil es que las dependencias todavía no se instalaron.
#
# @return [String,nil]
def theme_path
@theme_path ||=
if theme?
Dir[gem_path.join('gems', "#{config['theme']}-*").to_s].first
else
path
end
end
# @return [Pathname]
def gem_path def gem_path
@gem_path ||= @gem_path ||=
begin begin