fix: use absolute paths for file operations in release script

This commit is contained in:
Nathan Flurry 2026-02-05 00:08:20 -08:00
parent 7378abee46
commit 14f2743b9a

View file

@ -70,10 +70,11 @@ export async function updateVersion(opts: ReleaseOpts) {
const paths = await glob(globPath, { cwd: opts.root }); const paths = await glob(globPath, { cwd: opts.root });
assert(paths.length > 0, `no paths matched: ${globPath}`); assert(paths.length > 0, `no paths matched: ${globPath}`);
for (const path of paths) { for (const path of paths) {
const file = await fs.readFile(path, "utf-8"); const fullPath = `${opts.root}/${path}`;
assert(find.test(file), `file does not match ${find}: ${path}`); const file = await fs.readFile(fullPath, "utf-8");
assert(find.test(file), `file does not match ${find}: ${fullPath}`);
const newFile = file.replace(find, replace); const newFile = file.replace(find, replace);
await fs.writeFile(path, newFile); await fs.writeFile(fullPath, newFile);
await $({ cwd: opts.root })`git add ${path}`; await $({ cwd: opts.root })`git add ${path}`;
} }