File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
packages/@vue/cli-ui/src/graphql-api/connectors Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ const pkgCache = new LRU({
99
1010const cwd = require ( './cwd' )
1111
12+ function isDirectory ( file ) {
13+ try {
14+ return fs . statSync ( file . path ) . isDirectory ( )
15+ } catch ( e ) {
16+ console . warn ( e . message )
17+ }
18+ return false
19+ }
20+
1221async function list ( base , context ) {
1322 const files = await fs . readdir ( base , 'utf8' )
1423 return files . map (
@@ -17,7 +26,7 @@ async function list (base, context) {
1726 name : file
1827 } )
1928 ) . filter (
20- file => fs . statSync ( file . path ) . isDirectory ( )
29+ file => isDirectory ( file )
2130 )
2231}
2332
@@ -46,7 +55,12 @@ function openParent (file, context) {
4655}
4756
4857function isPackage ( file , context ) {
49- return fs . existsSync ( path . join ( file , 'package.json' ) )
58+ try {
59+ return fs . existsSync ( path . join ( file , 'package.json' ) )
60+ } catch ( e ) {
61+ console . warn ( e . message )
62+ }
63+ return false
5064}
5165
5266function readPackage ( file , context , force = false ) {
You can’t perform that action at this time.
0 commit comments