Respect --dest-dir when removing old default gems

Before this, tool/rbinstall would try to remove a gem file that
it may not have access too.

Fixes issue introduced in f550da512c.
This commit is contained in:
Jeremy Evans 2019-06-25 10:59:26 -07:00
Родитель a3d1cacda6
Коммит 51361272f9
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -827,7 +827,7 @@ def install_default_gem(dir, srcdir)
spec
}
gems.compact.sort_by(&:name).each do |gemspec|
old_gemspecs = Dir[File.join(default_spec_dir, "#{gemspec.name}-*.gemspec")]
old_gemspecs = Dir[File.join(with_destdir(default_spec_dir), "#{gemspec.name}-*.gemspec")]
if old_gemspecs.size > 0
old_gemspecs.each {|spec| FileUtils.rm spec }
end