kevva / download

Download and extract files
MIT License
1.28k stars 200 forks source link

Invalid permissions on extracted files from zip #46

Closed x1ddos closed 9 years ago

x1ddos commented 9 years ago

Not sure I'm doing something wrong but this:

var d = new Download({extract: true, strip: 1}, 'https://github.com/google/web-starter-kit/archive/v0.5.2.zip').dest('.')
d.run(function() { console.log('done') })

Results in:

$ ls -l
total 64
----------   1 crhyme  5000  11859 Feb 15 10:39 LICENSE
----------   1 crhyme  5000   5111 Feb 15 10:39 README.md
drwxr-xr-x  14 crhyme  5000    476 Feb 15 10:39 app
drwxr-xr-x   4 crhyme  5000    136 Feb 15 10:39 docs
----------   1 crhyme  5000   5625 Feb 15 10:39 gulpfile.js
----------   1 crhyme  5000    981 Feb 15 10:39 package.json

(first column, file permissions)

shinnn commented 9 years ago

I fixed decompress-unzip and published a new version.

Could you reinstall download and try it again? Maybe the issue is fixed.

x1ddos commented 9 years ago

Last time I tried it was about 1 hour ago, with Download v4.0.0. When did that fix get in? On 15 Feb 2015 11:10, "Shinnosuke Watanabe" notifications@github.com wrote:

I fixed decompress-zip https://github.com/kevva/decompress-unzip/commit/63f047d72f0a1f15eb1f889295099ba7e873eecd and published a new version.

Could you reinstall download try it again? Maybe the issue is fixed.

— Reply to this email directly or view it on GitHub https://github.com/kevva/download/issues/46#issuecomment-74413216.

shinnn commented 9 years ago

This module uses decompress-unzip to extract zip files, so I fixed the problem in this commit.

When did that fix get in?

About 13 minutes ago.

shinnn commented 9 years ago

I confirmed the issue was fixed.

'use strict';

var Download = require('download');

var download = new Download({extract: true, strip: 1})
  .get('https://github.com/google/web-starter-kit/archive/v0.5.2.zip')
  .dest('dest');

download.run(function() {
  console.log('done');
})
$ ls -l dest
-rw-r--r--   1 Shinnosuke  staff  11859  2 15 20:30 LICENSE
-rw-r--r--   1 Shinnosuke  staff   5111  2 15 20:30 README.md
drwxr-xr-x  14 Shinnosuke  staff    476  2 15 20:30 app/
drwxr-xr-x   4 Shinnosuke  staff    136  2 15 20:30 docs/
-rw-r--r--   1 Shinnosuke  staff   5625  2 15 20:30 gulpfile.js
-rw-r--r--   1 Shinnosuke  staff    981  2 15 20:30 package.json

Thanks for reporting, @crhym3.