File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
packages/@vue/cli-ui/src/graphql-api/connectors Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,23 @@ let onInstallProgress = null
32
32
let onInstallLog = null
33
33
34
34
function list ( context ) {
35
- return context . db . get ( 'projects' ) . value ( )
35
+ let projects = context . db . get ( 'projects' ) . value ( )
36
+ projects = autoClean ( projects , context )
37
+ return projects
38
+ }
39
+
40
+ function autoClean ( projects , context ) {
41
+ let result = [ ]
42
+ for ( const project of projects ) {
43
+ if ( fs . existsSync ( project . path ) ) {
44
+ result . push ( project )
45
+ }
46
+ }
47
+ if ( result . length !== projects . length ) {
48
+ console . log ( `Auto cleaned ${ projects . length - result . length } projects (folder not found).` )
49
+ context . db . set ( 'projects' , result ) . write ( )
50
+ }
51
+ return result
36
52
}
37
53
38
54
function getCurrent ( context ) {
You can’t perform that action at this time.
0 commit comments