forked from GitHubMirrors/silverbullet-icalendar
All checks were successful
Build SilverBullet Plug / build (push) Successful in 11s
20 lines
636 B
TypeScript
20 lines
636 B
TypeScript
// scripts/bump-version.ts
|
|
const denoConfigPath = "deno.json";
|
|
const denoConfig = JSON.parse(await Deno.readTextFile(denoConfigPath));
|
|
const currentVersion = denoConfig.version;
|
|
|
|
const parts = currentVersion.split(".").map(Number);
|
|
if (parts.length !== 3 || parts.some(isNaN)) {
|
|
console.error(`Invalid version format in deno.json: ${currentVersion}`);
|
|
Deno.exit(1);
|
|
}
|
|
|
|
// Increment patch version
|
|
parts[2]++;
|
|
const newVersion = parts.join(".");
|
|
|
|
denoConfig.version = newVersion;
|
|
await Deno.writeTextFile(denoConfigPath, JSON.stringify(denoConfig, null, 2) + "\n");
|
|
|
|
console.log(`Bumped version: ${currentVersion} -> ${newVersion}`);
|