Replace removed function in patch for assets::compile

`Dir.exists?(file_name) -> bool` have been deprecated since Ruby 2.1
and removed on Ruby 3.2.
See https://bugs.ruby-lang.org/issues/17391

Replacement is `Dir.exist?(file_name) -> bool`.
This commit is contained in:
Kazunori Kimura 2024-01-26 15:40:16 +09:00
parent 621daf2af5
commit 3e5f76f99e

View File

@ -11,7 +11,7 @@ index b8a6e7018767..5096d81ea63f 100644
+ # so do not remove the directory directly, empty instead
+ # Dir.glob("*") ignores dotfiles (even it is fine to remove here), so list up children manually
+ removal_targets = Dir.glob('app/assets/javascripts/locale/**/app.js')
+ if Dir.exists?(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR)
+ if Dir.exist?(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR)
+ removal_targets += Dir.children(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR).map {|child| File.join(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR, child)}
+ end
+ FileUtils.rm_rf(removal_targets, secure: true)