Utils/pre.js

16 lines
564 B
JavaScript
Raw Normal View History

2020-10-14 23:48:52 +00:00
const rjson = async (file) => JSON.parse(await Deno.readTextFile(file));
const wjson = (file, data) =>
Deno.writeTextFile(file, JSON.stringify(data, undefined, 3));
const pkg = await rjson("package.json");
const meta = await rjson("meta.json");
console.log("Changing meta.version from", meta.version, "to", pkg.version);
meta.version = pkg.version || meta.version;
// await wjson("meta.json", meta);
await Deno.copyFile("esm/index.js", "esm/mod.js");
await Deno.copyFile("esm/index.d.ts", "esm/mod.d.ts");
await Deno.copyFile("readme.md", "esm/readme.md");