Handle bug with non-existent directories
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 1m56s

This commit is contained in:
Dominik Milacher 2025-10-22 19:51:41 +02:00
parent 73083ded58
commit f3c3b8c239
2 changed files with 5 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.nuxt
.output
.idea
# Dependencies

View File

@ -18,6 +18,8 @@ export async function getConfig(): Promise<Configuration> {
export async function getRoutes(): Promise<Set<string>> {
async function find(directory: string): Promise<string[]> {
if (!existsSync(directory)) return []
const entries = await readdir(directory, { withFileTypes: true , recursive: true })
return entries.filter(e => e.isFile() && e.name.endsWith('.vue')).map(e => relative(directory, join(e.parentPath, e.name)))
}
@ -87,6 +89,6 @@ export async function getExpandedRoutes(config: Configuration): Promise<Set<stri
result.add(expanded.endsWith('/index') ? expanded.slice(0, -6) : expanded)
}
}
return result
}