Skip to content

Commit

Permalink
[rubygems/rubygems] Clear temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Apr 21, 2024
1 parent f87c216 commit 9b580ee
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/rubygems/commands/update_command.rb
Expand Up @@ -197,18 +197,17 @@ def preparing_gem_layout_for(version)
yield
else
require "tmpdir"
tmpdir = Dir.mktmpdir
FileUtils.mv Gem.plugindir, tmpdir
Dir.mktmpdir("gem_update") do |tmpdir|
FileUtils.mv Gem.plugindir, tmpdir

status = yield
status = yield

if status
FileUtils.rm_rf tmpdir
else
FileUtils.mv File.join(tmpdir, "plugins"), Gem.plugindir
end
unless status
FileUtils.mv File.join(tmpdir, "plugins"), Gem.plugindir
end

status
status
end
end
end

Expand Down

0 comments on commit 9b580ee

Please sign in to comment.