cloudflare update assets dir

This commit is contained in:
dswbx
2025-02-13 09:12:08 +01:00
parent 8e72b5b615
commit 68277a68d5
3 changed files with 34 additions and 11 deletions

View File

@@ -65,11 +65,18 @@ export async function replacePackageJsonVersions(
);
}
export async function updateBkndPackages(opts?: { dir?: string }) {
await replacePackageJsonVersions(async (pkg) => {
if (pkg === "bknd") {
return "^" + (await getVersion(pkg));
}
return;
}, opts);
export async function updateBkndPackages(dir?: string, map?: Record<string, string>) {
const versions = {
bknd: "^" + (await getVersion("bknd")),
...(map ?? {})
};
await replacePackageJsonVersions(
async (pkg) => {
if (pkg in versions) {
return versions[pkg];
}
return;
},
{ dir }
);
}