Skip to content

Commit

Permalink
Create app/assets/images on install for Sprockets 4 compatibility
Browse files Browse the repository at this point in the history
Sprockets 4 uses manifest files[1], and the default manifest.js
links `app/assets/images`. To prevent it from crashing due to the
directory not being present, the easiest solution is to create an
empty `app/assets/images` directory.

[1]: https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs
aldesantis committed Oct 23, 2019

Verified

This commit was signed with the committer’s verified signature.
messense messense
1 parent 7363581 commit b6713b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/lib/generators/spree/install/install_generator.rb
Original file line number Diff line number Diff line change
@@ -58,6 +58,9 @@ def additional_tweaks

def setup_assets
@lib_name = 'spree'

empty_directory 'app/assets/images'

%w{javascripts stylesheets images}.each do |path|
empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test?
empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test?

0 comments on commit b6713b2

Please sign in to comment.