Fixed a parsing bug relative to paths
This commit is contained in:
parent
7f5d5ba1b1
commit
15f38a3f62
@ -30,17 +30,22 @@ export class EndpointBrokerManagerFS {
|
||||
throw new Error("Broker already initialized")
|
||||
}
|
||||
|
||||
const configurations = (await listFiles(NGINX_TRACKED, true)).filter( async (path) => {
|
||||
if (await isDir(path)) {
|
||||
return false
|
||||
const candidateConfigurations = (await listFiles(NGINX_TRACKED, true))
|
||||
const configurations: string[] = []
|
||||
|
||||
for (const candidatePath of candidateConfigurations) {
|
||||
if (await isDir(candidatePath)) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (!path.endsWith(".conf")) {
|
||||
return false
|
||||
if (!candidatePath.endsWith(".conf")) {
|
||||
continue
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
configurations.push(candidatePath)
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (const confPath of configurations) {
|
||||
const file = await loadFile(confPath)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user