mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-13 14:31:10 -05:00
* Add step about requiring patrons.json file * Update steps to get DB up and running * Clarify Discord login setup instructions * Clarify how to start/stop server for new developers * Update README to remove unneeded .env.local var Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
34 lines
766 B
TypeScript
34 lines
766 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
import prisma from "../client";
|
|
|
|
// Include Prisma's .env file as well, so we can fetch the DATABASE_URL
|
|
require('dotenv').config({path: 'prisma/.env'});
|
|
|
|
const main = async () => {
|
|
const patrons = await prisma.user.findMany({
|
|
where: { patreonTier: { not: null } },
|
|
orderBy: { patreonTier: "desc" },
|
|
select: {
|
|
username: true,
|
|
discriminator: true,
|
|
patreonTier: true,
|
|
discordId: true,
|
|
},
|
|
});
|
|
|
|
fs.writeFile(
|
|
path.resolve(__dirname, "..", "..", "utils", "data", "patrons.json"),
|
|
JSON.stringify(patrons),
|
|
function (err) {
|
|
if (err) throw err;
|
|
}
|
|
);
|
|
};
|
|
|
|
main()
|
|
.catch((e) => console.error(e))
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|