chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-10-19 14:44:55 +02:00
parent c9ce29f206
commit 40e894df8b
294 changed files with 14209 additions and 4192 deletions

View file

@ -105,14 +105,15 @@ export default class ScriptUtils {
const specialfiles = ["./assets/themes/mapcomplete-changes/mapcomplete-changes.proto.json"]
const blacklist = ["assets/themes/mapcomplete-changes/mapcomplete-changes.json"]
const filtered = normalFiles.filter(path => !blacklist.some(black => path.endsWith(black)))
const filtered = normalFiles.filter(
(path) => !blacklist.some((black) => path.endsWith(black))
)
return filtered.concat(specialfiles)
}
public static getThemeFiles(useTranslationPaths = false): {
parsed: ThemeConfigJson;
path: string;
parsed: ThemeConfigJson
path: string
raw: string
}[] {
return this.getThemePaths(useTranslationPaths).map((path) => {
@ -209,17 +210,17 @@ export default class ScriptUtils {
path: urlObj.pathname + urlObj.search,
port: urlObj.port,
headers: headers
headers: headers,
},
(res) => {
const parts: string[] = []
res.setEncoding("utf8")
res.on("data", function(chunk) {
res.on("data", function (chunk) {
// @ts-ignore
parts.push(chunk)
})
res.addListener("end", function() {
res.addListener("end", function () {
if (res.statusCode === 301 || res.statusCode === 302) {
console.log("Got a redirect:", res.headers.location)
resolve({ redirect: res.headers.location })
@ -237,7 +238,7 @@ export default class ScriptUtils {
})
}
)
request.on("error", function(e) {
request.on("error", function (e) {
reject(e)
})
} catch (e) {