some stuff
This commit is contained in:
27
scripts/do-release.ts
Normal file
27
scripts/do-release.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { insertRelease } from "../src/server/dbal/dbal";
|
||||
import { ManifestType } from "../src/server/types";
|
||||
import { getCarts } from "../src/server/util/carts";
|
||||
import fs from "fs/promises";
|
||||
import path from "path";
|
||||
|
||||
const doRelease = async (dir: string) => {
|
||||
const manifest = JSON.parse(await fs.readFile(path.join(dir, "picobook.json"), "utf8"));
|
||||
|
||||
if (!ManifestType.Check(manifest)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const carts = await getCarts(dir, manifest.carts);
|
||||
|
||||
await insertRelease({
|
||||
manifest,
|
||||
carts,
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv[2]) {
|
||||
// console.log(process.argv[3]);
|
||||
await doRelease(process.argv[3]);
|
||||
} else {
|
||||
console.log("must pass in a path to a repo");
|
||||
}
|
Reference in New Issue
Block a user