diff --git a/lib/hanami/cli/generators/gem/app/setup.erb b/lib/hanami/cli/generators/gem/app/setup.erb index 7051702c..2cc18963 100644 --- a/lib/hanami/cli/generators/gem/app/setup.erb +++ b/lib/hanami/cli/generators/gem/app/setup.erb @@ -16,8 +16,10 @@ announce() { announce "Running bundle install..." bundle check || bundle install +<%- if generate_assets? -%> announce "\nRunning npm install..." npm install +<%- end -%> <%- if generate_db? -%> announce "\nPreparing the database..." diff --git a/spec/unit/hanami/cli/commands/gem/new_spec.rb b/spec/unit/hanami/cli/commands/gem/new_spec.rb index 40fad180..48fa469e 100644 --- a/spec/unit/hanami/cli/commands/gem/new_spec.rb +++ b/spec/unit/hanami/cli/commands/gem/new_spec.rb @@ -1430,6 +1430,9 @@ module Types # package.json expect(fs.exist?("package.json")).to be(false) + # bin/setup + expect(fs.read("bin/setup")).to_not match(/npm install/) + # Procfile.dev expect(fs.read("Procfile.dev")).to_not match(/hanami assets watch/)