sindresorhus / gulp-zip

ZIP compress files
MIT License
270 stars 47 forks source link

Subdirs in zip have wrong file attributes #76

Closed Noitidart closed 4 years ago

Noitidart commented 8 years ago

Issuehunt badges

Similar to this topic here - https://github.com/sindresorhus/gulp-zip/issues/62

This is still happening to me but only on SUB-directories, I am using v3.2.0 - however what I do differently is my main system is Windows. So I run the gulp script on my Windows system and when I send my zip to others who open it on Ubuntu they see this:

The first level directories are fine, but directories inside those directories are like this.

First level directories are fine:


IssueHunt Summary #### [jimbly jimbly](https://issuehunt.io/u/jimbly) has been rewarded. ### Backers (Total: $40.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($40.00) ### Submitted pull Requests - [#117 Fix creating unusable zip files on Windows (missing executable bit on directories)](https://issuehunt.io/r/sindresorhus/gulp-zip/pull/117) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/gulp-zip/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
dsaraswati commented 8 years ago

Is there a proper fix for this?

Noitidart commented 8 years ago

Thanks @dayanand-saraswati for your comment, I haven't found one yet.

thanh4890 commented 7 years ago

I'm having a similar problem, create a package from Windows and unzip in Ubuntu & Mac OS, but every files and sub-dir cannot be openned due to permission

Mac:

mac-1

Ubuntu:

gulp-zip-error

gulp-zip-error-2

gulp-zip-error-3

It should look like this:

gulp-zip-error-4

Scritik commented 7 years ago

Same issue. Any news?

lfire commented 7 years ago

I have fixed the problem by use gulp-chmod. pipe(chmod(0o755, 0o755))

Noitidart commented 7 years ago

@lfire does gulp-chmod work if it's execute on Windows platform?

lfire commented 7 years ago

@Noitidart yes, but I find another problem. https://github.com/sindresorhus/gulp-chmod/issues/12

lfire commented 7 years ago

@Noitidart The problem was solved, and the reason is use the wrong param. the param is pipe(chmod(0o755, 0o40755)). the detail please read https://github.com/sindresorhus/gulp-chmod/issues/12 hope to help you.

Noitidart commented 7 years ago

Thank you very much sir @lfire this is a superb work around till gulp-zip is fixed, thank you very very much!

yikuo123 commented 7 years ago

the same issue

raduserbanescu commented 7 years ago

Ran into this problem the past week. Here is an update of the current state of this problem.

In my opinion the underlaying issue is not with any of these npm packages, nor with Node.js itself. gulp-zip merely creates explicit directory entries in the zip file, copying their permissions.

yazl, the actual package used to compress, always makes UNIX like archives. Other Windows archivers (like 7-Zip) make FAT archives witch avoid problems with permissions. See: yazl docs and this answer here.

Unlike Linux, Windows doesn't require that directories be executable in order to allow access.

This comment explains it very well. @lfire's solution and this one work very well for the moment.

One solution, if @sindresorhus agrees, is for this package to check if running on Windows and make sure a directory has execution permission before adding it to the archive.

nk-o commented 7 years ago

The same problem. Moved to https://github.com/joaomoreno/gulp-vinyl-zip since this issue still not resolved.

IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.


Cristy94 commented 4 years ago

This is breaking issue for gulp-zip when developing on Windows. Is there at least a work-around until a fix is released?

issuehunt-oss[bot] commented 4 years ago

@sindresorhus has rewarded $36.00 to @jimbly. See it on IssueHunt