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

@ -28,7 +28,7 @@ for (let i = 0; i < avis.length; i++) {
} }
await writeFile( await writeFile(
join("../../", "db", "data.json"), join("../../", "source", "data.json"),
format( format(
JSON.stringify({ JSON.stringify({
avatars, avatars,

View file

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

View file

@ -5,10 +5,10 @@ on:
branches: branches:
- main - main
paths: paths:
- ".github/workflows/generate-db.yml" - ".github/workflows/generate-source.yml"
- ".github/scripts/generate/**/*.*" - ".github/scripts/generate/**/*.*"
- "db/data.json" - "source/data.json"
- "db/template.css" - "source/template.css"
pull_request: pull_request:
branches: branches:
- main - main
@ -50,6 +50,6 @@ jobs:
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add db/dist.css git add source/import.css
git commit -m "chore(db): update dist.css (${{ github.sha || 'manual trigger' }})" || true git commit -m "Update import.css (${{ github.sha || 'manual trigger' }})" || true
git push git push

1
source/dist.css Normal file

File diff suppressed because one or more lines are too long