Skip to content

Commit

Permalink
Replace bundle_cleanly with AppBase methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmendoza committed Dec 2, 2022
1 parent d1e134f commit 26a6e15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def install_plugin(plugin_name:, plugin_generator_name:)
end

gem plugin_name
BundlerContext.bundle_cleanly { run "bundle install" }
run_bundle
run "spring stop" if defined?(Spring)
generate "#{plugin_generator_name} --skip_migrations=true"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,11 @@ def call(frontend)

private

def bundle_command(command)
@generator_context.say_status :run, "bundle #{command}"
bundle_path = Gem.bin_path("bundler", "bundle")

BundlerContext.bundle_cleanly do
system(
Gem.ruby,
bundle_path,
*command.shellsplit,
)
end
end

def install_solidus_frontend
unless @bundler_context.component_in_gemfile?(:frontend)
bundle_command 'add solidus_frontend'
# `Rails::Generator::AppBase#bundle_command` is protected so have to `send` it.
# See https://api.rubyonrails.org/v3.2.16/classes/Rails/Generators/AppBase.html#method-i-run_bundle
@generator_context.send :bundle_command, 'add solidus_frontend'
end

# Solidus bolt will be handled in the installer as a payment method.
Expand Down

0 comments on commit 26a6e15

Please sign in to comment.