File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33var binCheck = require ( 'bin-check' ) ;
44var binVersionCheck = require ( 'bin-version-check' ) ;
55var Download = require ( 'download' ) ;
6- var globby = require ( 'globby ' ) ;
6+ var fs = require ( 'fs ' ) ;
77var osFilterObj = require ( 'os-filter-obj' ) ;
88var path = require ( 'path' ) ;
99
@@ -119,7 +119,7 @@ BinWrapper.prototype.run = function (cmd, cb) {
119119 cmd = [ '--version' ] ;
120120 }
121121
122- this . findExisting ( function ( err , files ) {
122+ this . findExisting ( function ( err ) {
123123 if ( err ) {
124124 cb ( err ) ;
125125 return ;
@@ -170,18 +170,18 @@ BinWrapper.prototype.runCheck = function (cmd, cb) {
170170 */
171171
172172BinWrapper . prototype . findExisting = function ( cb ) {
173- globby ( this . path ( ) , function ( err , files ) {
174- if ( err ) {
175- cb ( err ) ;
173+ fs . stat ( this . path ( ) , function ( err ) {
174+ if ( err && err . code === 'ENOENT' ) {
175+ this . download ( cb ) ;
176176 return ;
177177 }
178178
179- if ( ! files . length ) {
180- this . download ( cb ) ;
179+ if ( err ) {
180+ cb ( err ) ;
181181 return ;
182182 }
183183
184- cb ( null , files ) ;
184+ cb ( ) ;
185185 } . bind ( this ) ) ;
186186} ;
187187
Original file line number Diff line number Diff line change 2828 "bin-check" : " ^1.0.0" ,
2929 "bin-version-check" : " ^2.1.0" ,
3030 "download" : " ^4.0.0" ,
31- "globby " : " ^1.0.0 " ,
31+ "each-async " : " ^1.1.1 " ,
3232 "os-filter-obj" : " ^1.0.0"
3333 },
3434 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments