Skip to content

Commit b99ca03

Browse files
committed
impr(release script): fix missing imports, incorrect path
1 parent f4d3380 commit b99ca03

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bin/release.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Octokit } from "@octokit/rest";
33
import dotenv from "dotenv";
44
import { readFileSync } from "fs";
55
import readlineSync from "readline-sync";
6+
import path, { dirname } from "path";
7+
import fs from "fs";
68

79
dotenv.config();
810

@@ -86,7 +88,7 @@ const updatePackage = (newVersion) => {
8688
console.log(`[Dry Run] Updated package.json to version ${newVersion}`);
8789
return;
8890
}
89-
const packagePath = path.resolve(__dirname, "package.json");
91+
const packagePath = path.resolve(__dirname, "../package.json");
9092

9193
// Read the package.json file
9294
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf8"));
@@ -95,7 +97,11 @@ const updatePackage = (newVersion) => {
9597
packageJson.version = newVersion.replace("v", "");
9698

9799
// Write the updated JSON back to package.json
98-
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2), "utf8");
100+
fs.writeFileSync(
101+
packagePath,
102+
JSON.stringify(packageJson, null, 2) + "\n",
103+
"utf8"
104+
);
99105

100106
console.log(`Updated package.json to version ${newVersion}`);
101107
};

0 commit comments

Comments
 (0)