exclude __MACOSX dir when unzipping

should take care of #222
This commit is contained in:
phinze 2013-04-28 11:38:09 -05:00
parent 2b7b530bf5
commit 0de91ed257
4 changed files with 16 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class Cask::Installer
elsif _zip?(path)
destdir = "/tmp/brewcask_#{@title}_extracted"
`mkdir -p '#{destdir}'`
`unzip -d '#{destdir}' '#{path}'`
`unzip -d '#{destdir}' '#{path}' -x '__MACOSX/*'`
begin
yield destdir
ensure

View File

@ -61,6 +61,14 @@ describe Cask::Installer do
}, /Here are some things you might want to know/)
with_caveats.must_be :installed?
end
it "does not extract __MACOSX directories from zips" do
with_macosx_dir = Cask.load('with-macosx-dir')
shutup do
Cask::Installer.install(with_macosx_dir)
end
with_macosx_dir.destination_path.join('__MACOSX').wont_be :directory?
end
end
describe "uninstall" do

View File

@ -0,0 +1,6 @@
class WithMacosxDir < TestCask
url TestHelper.local_binary('MyFancyApp.zip')
homepage 'http://example.com/MyFancyApp'
version '1.2.3'
sha1 'b0475c34136c8e00ceb4b95c245291d53d5deab3'
end

Binary file not shown.