Skip to content

Commit

Permalink
Build script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Oct 18, 2024
1 parent a47b95d commit c053ba3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ if (Deno.args[1] === "clean") {
/* Handle argument `package`: Generate package.json based on a base config and values from deno,json */
} else if (Deno.args[1] === "package") {
// Read version from deno.json
const denoConfig = await readJson<{ version: string }>(resolve(relativeProjectRoot, "deno.json"));
const denoConfig = await readJson<{ version: string; name: string }>(
resolve(relativeProjectRoot, "deno.json"),
);

// Write package.json
await writeFile(
resolve(relativeProjectRoot, "package.json"),
new TextEncoder().encode(JSON.stringify(
{
...await readJson<object>(resolve(relativeProjectRoot, "build/package.template.json")),
name: denoConfig.name,
version: denoConfig.version,
},
null,
Expand Down

0 comments on commit c053ba3

Please sign in to comment.