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({
9
9
10
10
const cwd = require ( './cwd' )
11
11
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
+
12
21
async function list ( base , context ) {
13
22
const files = await fs . readdir ( base , 'utf8' )
14
23
return files . map (
@@ -17,7 +26,7 @@ async function list (base, context) {
17
26
name : file
18
27
} )
19
28
) . filter (
20
- file => fs . statSync ( file . path ) . isDirectory ( )
29
+ file => isDirectory ( file )
21
30
)
22
31
}
23
32
@@ -46,7 +55,12 @@ function openParent (file, context) {
46
55
}
47
56
48
57
function 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
50
64
}
51
65
52
66
function readPackage ( file , context , force = false ) {
You can’t perform that action at this time.
0 commit comments