about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-09-25 23:58:12 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-25 16:58:12 +0200
commit0fea700c7be051ace98c2b3426531862c73565bb (patch)
tree71e5f5c9e370c66134a19041b9348eff4be16292 /lib
parent2c8e3fbbfbe26fb78418324ef14caf13ab207623 (diff)
Refresh manifest before generate 500.html (#5090)
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/assets.rake13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index cd0a3bd2b..ad7c6ba90 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -1,8 +1,17 @@
 # frozen_string_literal: true
 
-if Rake::Task.task_defined?('assets:precompile')
-  Rake::Task['assets:precompile'].enhance do
+namespace :assets do
+  desc 'Generate 500.html'
+  task :generate_500 do
     html = ApplicationController.render('errors/500', layout: 'error')
     File.write(Rails.root.join('public', '500.html'), html)
   end
 end
+
+if Rake::Task.task_defined?('assets:precompile')
+  Rake::Task['assets:precompile'].enhance do
+    Webpacker::Manifest.load
+
+    Rake::Task['assets:generate_500'].invoke
+  end
+end