mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 02:11:42 +00:00
fix: en algunos casos el directorio existía aunque vacío #13428
This commit is contained in:
parent
310bd31710
commit
8d9328cd66
1 changed files with 13 additions and 3 deletions
|
@ -561,15 +561,25 @@ class Site < ApplicationRecord
|
|||
deploy_local = deploys.find_by_type('DeployLocal')
|
||||
deploy_local.git_lfs
|
||||
|
||||
if !gem_dir? || gemfile_updated? || gemfile_lock_updated?
|
||||
if !gems_installed? || gemfile_updated? || gemfile_lock_updated?
|
||||
deploy_local.bundle
|
||||
touch
|
||||
end
|
||||
end
|
||||
|
||||
def gem_path
|
||||
@gem_path ||=
|
||||
begin
|
||||
ruby_version = Gem::Version.new(RUBY_VERSION)
|
||||
ruby_version.canonical_segments[2] = 0
|
||||
|
||||
bundle_path.join('ruby', ruby_version.canonical_segments.join('.'))
|
||||
end
|
||||
end
|
||||
|
||||
# Detecta si el repositorio de gemas existe
|
||||
def gem_dir?
|
||||
Rails.root.join('_storage', 'gems', name).directory?
|
||||
def gems_installed?
|
||||
gem_path.directory? && !gem_path.empty?
|
||||
end
|
||||
|
||||
# Detecta si el Gemfile fue modificado
|
||||
|
|
Loading…
Reference in a new issue