dev-cmd/bottle: clean up intermediate tar

Otherwise Cellar gets cluttered.

Fixes https://github.com/Homebrew/brew/issues/12744.
This commit is contained in:
Adrian Ho 2022-01-18 15:42:01 +08:00
parent ec389a6eaa
commit af4955adfc
2 changed files with 2 additions and 0 deletions

View File

@ -446,6 +446,7 @@ module Homebrew
gz.write(tarfile.read(GZIP_BUFFER_SIZE)) until tarfile.eof?
end
gz.close
rm_f relocatable_tar_path
sudo_purge
end

View File

@ -21,6 +21,7 @@ describe "brew bottle" do
.to output(/testball--0\.1.*\.bottle\.tar\.gz/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
expect(HOMEBREW_CELLAR/"testball-bottle.tar").not_to exist
ensure
FileUtils.rm_f Dir.glob("testball--0.1*.bottle.tar.gz")
end