We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
Learn more about funding links in repositories.
Report abuse
1 parent 133cdfb commit d2a9d0fCopy full SHA for d2a9d0f
packages/@vue/cli-ui/src/graphql-api/connectors/projects.js
@@ -32,7 +32,23 @@ let onInstallProgress = null
32
let onInstallLog = null
33
34
function list (context) {
35
- return context.db.get('projects').value()
+ 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
52
}
53
54
function getCurrent (context) {
0 commit comments