Skip to content

Commit 4ef1a0e

Browse files
committed
Dummy app generator: Only configure app/assets/javascripts if present
Newer versions of Rails generators do not generate the `app/assets/javascripts` directory. Let's not add it to the Sprockets config if it's not there. (cherry picked from commit ca1af55)
1 parent b7465ae commit 4ef1a0e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

core/lib/generators/spree/dummy/dummy_generator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def generate_test_dummy
5454
def test_dummy_config
5555
@lib_name = options[:lib_name]
5656
@database = options[:database]
57+
@has_javascripts = Dir.exist?("#{dummy_path}/app/assets/javascripts")
5758

5859
template "rails/database.yml", "#{dummy_path}/config/database.yml", force: true
5960
template "rails/storage.yml", "#{dummy_path}/config/storage/test.yml", force: true
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
//= link_tree ../images
2+
<% if @has_javascripts %>
23
//= link_directory ../javascripts .js
4+
<% end %>
35
//= link_directory ../stylesheets .css

0 commit comments

Comments
 (0)