Skip to content

Commit fc3bb3e

Browse files
realitykingsindresorhus
authored andcommitted
Update most dependencies (#60)
1 parent 0041e91 commit fc3bb3e

2 files changed

Lines changed: 20 additions & 24 deletions

File tree

index.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,20 @@ module.exports = class BinWrapper {
138138
* @api private
139139
*/
140140
runCheck(cmd, cb) {
141-
binCheck()(this.path(), cmd, (err, works) => {
142-
if (err) {
143-
cb(err);
144-
return;
145-
}
146-
147-
if (!works) {
148-
cb(new Error(`The \`${this.path()}\` binary doesn't seem to work correctly`));
149-
return;
150-
}
151-
152-
if (this.version()) {
153-
binVersionCheck()(this.path(), this.version(), cb);
154-
return;
155-
}
156-
157-
cb();
158-
});
141+
binCheck(this.path(), cmd)
142+
.then(works => {
143+
if (!works) {
144+
throw new Error(`The \`${this.path()}\` binary doesn't seem to work correctly`);
145+
}
146+
147+
if (this.version()) {
148+
return binVersionCheck(this.path(), this.version());
149+
}
150+
151+
return Promise.resolve();
152+
})
153+
.then(() => cb())
154+
.catch(err => cb(err));
159155
}
160156

161157
/**
@@ -187,8 +183,8 @@ module.exports = class BinWrapper {
187183
* @api private
188184
*/
189185
download(cb) {
190-
const files = osFilterObj()(this.src());
191-
const download = new Download()({
186+
const files = osFilterObj(this.src() || []);
187+
const download = new Download({
192188
extract: true,
193189
mode: '755',
194190
strip: this.options.strip

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"wrapper"
2626
],
2727
"dependencies": {
28-
"bin-check": "^2.0.0",
29-
"bin-version-check": "^2.1.0",
28+
"bin-check": "^4.1.0",
29+
"bin-version-check": "^3.0.0",
3030
"download": "^4.0.0",
31-
"import-lazy": "^2.1.0",
32-
"os-filter-obj": "^1.0.0"
31+
"import-lazy": "^3.1.0",
32+
"os-filter-obj": "^2.0.0"
3333
},
3434
"devDependencies": {
3535
"ava": "*",

0 commit comments

Comments
 (0)