Skip to content

Commit 90abfe6

Browse files
committed
Remove git-related files in unpacked gems
These files, including `.github` directory, are useless unless the repository itself is contained as well.
1 parent eab4a0b commit 90abfe6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tool/lib/bundled_gem.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ module BundledGem
2020

2121
def unpack(file, *rest)
2222
pkg = Gem::Package.new(file)
23-
prepare_test(pkg.spec, *rest) {|dir| pkg.extract_files(dir)}
23+
prepare_test(pkg.spec, *rest) do |dir|
24+
pkg.extract_files(dir)
25+
FileUtils.rm_rf(Dir.glob(".git*", base: dir).map {|n| File.join(dir, n)})
26+
end
2427
puts "Unpacked #{file}"
2528
rescue Gem::Package::FormatError, Errno::ENOENT
2629
puts "Try with hash version of bundled gems instead of #{file}. We don't use this gem with release version of Ruby."

0 commit comments

Comments
 (0)