Skip to content

Commit

Permalink
Merge pull request #5011 from nebulab/safafa+kennyadsl/remove-auto-ac…
Browse files Browse the repository at this point in the history
…cept-propagation

Remove automatic propagation of generators options
  • Loading branch information
kennyadsl authored Apr 19, 2023
2 parents 4b9b955 + 56d7a0f commit 5111949
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
bundle_command 'add solidus_bolt'
end

generate 'solidus_bolt:install'
generate "solidus_bolt:install --auto-run-migrations=#{options[:migrate]}"
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
bundle_command 'add solidus_braintree --version "~> 3.0"'
end

generate 'solidus_braintree:install'
generate "solidus_braintree:install --migrate=#{options[:migrate]}"
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
say_status :warning, "Support for frontends other than `solidus_frontend` by `solidus_paypal_commerce_platform` is still in progress.", :yellow
end

if @selected_frontend == 'classic'
version = '< 1'
migrations_flag = options[:migrate] ? '--auto-run-migrations' : '--skip-migrations'
else
version = '~> 1.0'
migrations_flag = "--migrate=#{options[:migrate]}"
end

unless Bundler.locked_gems.dependencies['solidus_paypal_commerce_platform']
version = @selected_frontend == 'classic' ? '< 1' : '~> 1.0'
bundle_command "add solidus_paypal_commerce_platform --version='#{version}'"
end

generate 'solidus_paypal_commerce_platform:install'
generate "solidus_paypal_commerce_platform:install #{migrations_flag}"
6 changes: 0 additions & 6 deletions core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ def complete

private

def generate(what, *args, abort_on_failure: true)
args << '--auto-accept' if options[:auto_accept]
args << '--auto-run-migrations' if options[:migrate]
super(what, *args, abort_on_failure: abort_on_failure)
end

def bundle_command(command, env = {})
# Make `bundle install` less verbose by skipping the "Using ..." messages
super(command, env.reverse_merge('BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES' => 'true'))
Expand Down

0 comments on commit 5111949

Please sign in to comment.