Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompressor/zip: fix behavior with subdirectories #17

Merged
merged 1 commit into from Mar 21, 2016
Merged

Conversation

mitchellh
Copy link
Contributor

Fixes #11

This fixes two bugs:

  • Empty directories had an incorrect boolean statement causing them to not unzip.
  • Zips that contained files in subdirectories without an empty subdirectory entry would fail to decompress.

Test cases for all of this are added.

@@ -46,7 +46,7 @@ func (d *ZipDecompressor) Decompress(dst, src string, dir bool) error {
}

if f.FileInfo().IsDir() {
if dir {
if !dir {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is how we were seeing this error here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is right. This will fix that.

@dadgar
Copy link
Contributor

dadgar commented Mar 21, 2016

LGTM

mitchellh added a commit that referenced this pull request Mar 21, 2016
decompressor/zip: fix behavior with subdirectories
@mitchellh mitchellh merged commit ea6671f into master Mar 21, 2016
@mitchellh mitchellh deleted the b-zip-dir branch March 21, 2016 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zip files that contain directories that don't exist on dest fail
2 participants