mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 02:31:41 +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 = deploys.find_by_type('DeployLocal')
|
||||||
deploy_local.git_lfs
|
deploy_local.git_lfs
|
||||||
|
|
||||||
if !gem_dir? || gemfile_updated? || gemfile_lock_updated?
|
if !gems_installed? || gemfile_updated? || gemfile_lock_updated?
|
||||||
deploy_local.bundle
|
deploy_local.bundle
|
||||||
touch
|
touch
|
||||||
end
|
end
|
||||||
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
|
# Detecta si el repositorio de gemas existe
|
||||||
def gem_dir?
|
def gems_installed?
|
||||||
Rails.root.join('_storage', 'gems', name).directory?
|
gem_path.directory? && !gem_path.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Detecta si el Gemfile fue modificado
|
# Detecta si el Gemfile fue modificado
|
||||||
|
|
Loading…
Reference in a new issue