File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ var plugin = require('shelljs/plugin');
33
44// Require whatever modules you need for your project
55var opener = require ( 'opener' ) ;
6- var fs = require ( 'fs ' ) ;
6+ var pathExists = require ( 'path-exists ' ) ;
77
88// Implement your command in a function, which accepts `options` as the
99// first parameter, and other arguments after that
1010function open ( options , fileName ) {
1111 var URL_REGEX = / ^ h t t p s ? : \/ \/ .* / ;
1212
13- if ( ! fs . existsSync ( fileName ) && ! fileName . match ( URL_REGEX ) ) {
13+ if ( ! pathExists . sync ( fileName ) && ! fileName . match ( URL_REGEX ) ) {
1414 plugin . error ( 'Unable to locate file: ' + fileName ) ;
1515 }
1616
Original file line number Diff line number Diff line change 4040 "shelljs" : " ^0.7.3"
4141 },
4242 "dependencies" : {
43- "opener" : " ^1.4.1"
43+ "opener" : " ^1.4.1" ,
44+ "path-exists" : " ^3.0.0"
4445 }
4546}
You can’t perform that action at this time.
0 commit comments