Changed the data stuff from db to source and changed the dist.css name to import.css because more userfriendliness(tm) hopefully not nuking everything, i kept the old dist so i dont also nuke the import link for everyone

This commit is contained in:
coolesding 2023-10-02 10:49:45 +02:00 committed by GitHub
parent 9988b98f03
commit 4868f921dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 10 deletions

View file

@ -8,7 +8,7 @@ const uglify = !process.argv.includes("--debug");
console.log("Getting templates...");
const templateLines = (
await readFile(join("../../", "db", "template.css"), "utf8")
await readFile(join("../../", "source", "template.css"), "utf8")
)
.replace(/\r/g, "")
.split("\n");
@ -31,9 +31,9 @@ for (const id of Object.keys(templates)) {
else throw new Error(`Failed to get template lines for: ${id}`);
}
console.log("Generating dist.css...");
console.log("Generating import.css...");
const data = JSON.parse(
await readFile(join("../../", "db", "data.json"), "utf8")
await readFile(join("../../", "source", "data.json"), "utf8")
);
const dist = [];
@ -46,7 +46,7 @@ for (const [bid, img] of Object.entries(data.badges)) {
}
await writeFile(
join("../../", "db", "dist.css"),
join("../../", "source", "import.css"),
uglify ? UglifyCSS.processString(dist.join("\n")) : dist.join("\n\n")
);