Skip to content

Commit

Permalink
Install Webpacker in install generator (AlchemyCMS#1835)
Browse files Browse the repository at this point in the history
We use this generator in the Alchemy ecosystem, and the dummy apps of
gems like alchemy-devise or alchemy-solidus need webpacker installed to
function.
  • Loading branch information
mamhoff authored May 18, 2020
1 parent 02983a0 commit 2cb3228
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/generators/alchemy/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class InstallGenerator < ::Rails::Generators::Base
default: false,
desc: "Skip creation of demo element, page and application layout."

class_option :skip_webpacker_installer,
type: :boolean,
default: false,
desc: "Skip running the webpacker installer."

source_root File.expand_path("files", __dir__)

def copy_config
Expand Down Expand Up @@ -55,6 +60,12 @@ def install_gutentag_migrations
rake "gutentag:install:migrations"
end

def run_webpacker_installer
unless options[:skip_webpacker_installer]
rake("webpacker:install", abort_on_failure: true)
end
end

private

def gem_config_path
Expand Down

0 comments on commit 2cb3228

Please sign in to comment.