Skip to content

Commit

Permalink
Swapping should not raise any errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Jun 9, 2022
1 parent 1a25eb7 commit 600a9ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bundler/lib/bundler/source/rubygems.rb
Expand Up @@ -157,11 +157,12 @@ def install(spec, options = {})
path = fetch_gem(spec, options[:previous_spec])
begin
s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
spec.__swap__(s)
rescue Gem::Package::FormatError
Bundler.rm_rf(path)
raise
end

spec.__swap__(s)
else
path = cached_gem(spec)
raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
Expand Down

0 comments on commit 600a9ac

Please sign in to comment.