diff options
author | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2018-05-08 16:31:47 +0900 |
---|---|---|
committer | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2018-05-16 20:24:57 +0900 |
commit | 7b0a316f2db449cfebe9897c74160378f9e4dc85 (patch) | |
tree | 218079430214488f3bab9d30f591c4d675e6e22c /railties/lib/rails | |
parent | bfe4248c78ce6e93ebba8c7b9ada1c68cd79bb85 (diff) | |
download | rails-7b0a316f2db449cfebe9897c74160378f9e4dc85.tar.gz rails-7b0a316f2db449cfebe9897c74160378f9e4dc85.tar.bz2 rails-7b0a316f2db449cfebe9897c74160378f9e4dc85.zip |
Don't generate yarn's contents in `app:update` task if it's skipped
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/app_updater.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/railties/lib/rails/app_updater.rb b/railties/lib/rails/app_updater.rb index e37839bf11..a243968a39 100644 --- a/railties/lib/rails/app_updater.rb +++ b/railties/lib/rails/app_updater.rb @@ -21,6 +21,7 @@ module Rails private def generator_options options = { api: !!Rails.application.config.api_only, update: true } + options[:skip_yarn] = !File.exist?(Rails.root.join("bin", "yarn")) options[:skip_active_record] = !defined?(ActiveRecord::Railtie) options[:skip_active_storage] = !defined?(ActiveStorage::Engine) || !defined?(ActiveRecord::Railtie) options[:skip_action_mailer] = !defined?(ActionMailer::Railtie) diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 0d2766c1ca..34067240d7 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -95,11 +95,9 @@ module Rails end def bin_when_updating - bin_yarn_exist = File.exist?("bin/yarn") - bin - if options[:api] && !bin_yarn_exist + if options[:skip_yarn] remove_file "bin/yarn" end end |