File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" : " *" ,
You can’t perform that action at this time.
0 commit comments