Handle bug with non-existent directories
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 1m56s
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 1m56s
This commit is contained in:
parent
73083ded58
commit
f3c3b8c239
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,7 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
.nuxt
|
||||
.output
|
||||
.idea
|
||||
|
||||
# Dependencies
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user