Skip to content

Commit 7fee790

Browse files
rejassindresorhus
authored andcommitted
Update to download 7.1.0 (#65)
1 parent fc3bb3e commit 7fee790

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: node_js
22
node_js:
3+
- '10'
34
- '8'
45
- '6'

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const importLazy = require('import-lazy')(require);
55

66
const binCheck = importLazy('bin-check');
77
const binVersionCheck = importLazy('bin-version-check');
8-
const Download = importLazy('download');
8+
const download = importLazy('download');
99
const osFilterObj = importLazy('os-filter-obj');
1010

1111
/**
@@ -184,21 +184,21 @@ module.exports = class BinWrapper {
184184
*/
185185
download(cb) {
186186
const files = osFilterObj(this.src() || []);
187-
const download = new Download({
188-
extract: true,
189-
mode: '755',
190-
strip: this.options.strip
191-
});
187+
const urls = [];
192188

193189
if (files.length === 0) {
194190
cb(new Error('No binary found matching your system. It\'s probably not supported.'));
195191
return;
196192
}
197193

198-
files.forEach(file => download.get(file.url));
194+
files.forEach(file => urls.push(file.url));
199195

200-
download
201-
.dest(this.dest())
202-
.run(cb);
196+
Promise.all(urls.map(url => download(url, this.dest(), {
197+
extract: true,
198+
mode: '755',
199+
strip: this.options.strip
200+
}))).then(() => {
201+
cb();
202+
});
203203
}
204204
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"dependencies": {
2828
"bin-check": "^4.1.0",
2929
"bin-version-check": "^3.0.0",
30-
"download": "^4.0.0",
30+
"download": "^7.1.0",
3131
"import-lazy": "^3.1.0",
3232
"os-filter-obj": "^2.0.0"
3333
},
3434
"devDependencies": {
3535
"ava": "*",
36-
"nock": "^9.2.3",
36+
"nock": "^9.4.2",
3737
"path-exists": "^3.0.0",
3838
"pify": "^3.0.0",
39-
"rimraf": "^2.2.8",
39+
"rimraf": "^2.6.2",
4040
"tempy": "^0.2.1",
4141
"xo": "*"
4242
}

0 commit comments

Comments
 (0)