mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-14 17:08:21 +00:00
Merge branch 'issue-16282' into 'rails'
Issue #16282 See merge request sutty/sutty!262
This commit is contained in:
commit
653a6e8f49
1 changed files with 23 additions and 6 deletions
|
@ -589,17 +589,34 @@ class Site < ApplicationRecord
|
|||
# * El archivo Gemfile.lock se modificó
|
||||
def install_gems
|
||||
return unless persisted?
|
||||
return unless (!gems_installed? || theme_path.blank?) || gemfile_updated? || gemfile_lock_updated?
|
||||
|
||||
deploy_local = deploys.find_by_type('DeployLocal')
|
||||
deploy_local.git_lfs
|
||||
|
||||
return unless !gems_installed? || gemfile_updated? || gemfile_lock_updated?
|
||||
|
||||
deploy_local.bundle
|
||||
deploys.find_by_type('DeployLocal').bundle
|
||||
touch
|
||||
FileUtils.touch(gemfile_path)
|
||||
end
|
||||
|
||||
# El sitio tiene una plantilla
|
||||
#
|
||||
# @return [Bool]
|
||||
def theme?
|
||||
config['theme'].present?
|
||||
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
|
||||
@gem_path ||=
|
||||
begin
|
||||
|
|
Loading…
Reference in a new issue