gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/lib/tasks/assets.rake

19 lines
505 B
Ruby

# frozen_string_literal: true
namespace :assets do
desc 'Generate 500.html'
task :generate_500 do
I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
html = ApplicationController.render('errors/500', layout: 'error')
File.write(Rails.root.join('public', '500.html'), html)
end
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