Newer
Older
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
// eslint-disable-next-line no-console
const log = (...msg: any[]) => console.log(...msg);
async function main() {
// pxls palette 13
// https://github.com/pxlsspace/Pxls/commit/1e0d85ddfc1258e6fc0ff9a0c1b1bff06cd9ee21
const palette: { name: string; hex: string }[] = [
{
name: "White",
hex: "FFFFFF",
},
{
name: "Light Grey",
{
name: "Black",
hex: "000000",
},
{
name: "Dark Chocolate",
},
{
name: "Pastel Yellow",
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
},
];
for (const { name, hex } of palette) {
log("Ensuring color", { name, hex });
await prisma.paletteColor.upsert({
where: { hex },
update: {},
create: {
name,
hex,
},
});
}
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
// eslint-disable-next-line no-console
console.error(e);
await prisma.$disconnect();
process.exit(1);
});