Fix of init scripts

This commit is contained in:
pietervdvn 2021-05-07 12:39:37 +02:00
parent f0c9fc20fe
commit a1ca76dc48

View file

@ -136,6 +136,28 @@ function generateTagInfoEntry(layout: LayoutConfig): any {
return filename return filename
} }
// Write the URLS to the taginfo repository. Might fail if the repository is not checked ou
function generateProjectsOverview() {
try {
const tagInfoList = "../taginfo-projects/project_list.txt"
let projectList = readFileSync(tagInfoList, "UTF8")
.split("\n")
.filter(entry => entry.indexOf("mapcomplete_") < 0)
.concat(files.map(f => `${f} https://raw.githubusercontent.com/pietervdvn/MapComplete/master/Docs/TagInfo/${f}.json`))
.sort()
.filter(entry => entry != "")
console.log("Writing taginfo project filelist");
writeFileSync(tagInfoList, projectList.join("\n") + "\n");
} catch (e) {
console.warn("Could not write the taginfo-projects list - the repository is probably not checked out. Are you creating a fork? Ignore this message then.")
}
}
console.log("Creating taginfo project files") console.log("Creating taginfo project files")
@ -150,15 +172,4 @@ for (const layout of AllKnownLayouts.layoutsList) {
} }
files.push(generateTagInfoEntry(layout)); files.push(generateTagInfoEntry(layout));
} }
generateProjectsOverview();
const tagInfoList = "../taginfo-projects/project_list.txt"
let projectList = readFileSync(tagInfoList, "UTF8")
.split("\n")
.filter(entry => entry.indexOf("mapcomplete_") < 0)
.concat(files.map(f => `${f} https://raw.githubusercontent.com/pietervdvn/MapComplete/master/Docs/TagInfo/${f}.json`))
.sort()
.filter(entry => entry != "")
console.log("Writing taginfo project filelist");
writeFileSync(tagInfoList, projectList.join("\n") + "\n");