mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 08:03:46 +00:00
fix: use absolute paths for file operations in release script
This commit is contained in:
parent
7378abee46
commit
14f2743b9a
1 changed files with 4 additions and 3 deletions
|
|
@ -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}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue