diff options
Diffstat (limited to 'tools/release/03_bump_cli_version.ts')
-rwxr-xr-x | tools/release/03_bump_cli_version.ts | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/tools/release/03_bump_cli_version.ts b/tools/release/03_bump_cli_version.ts index e2a64ede0..bd1f3d1c6 100755 --- a/tools/release/03_bump_cli_version.ts +++ b/tools/release/03_bump_cli_version.ts @@ -1,19 +1,17 @@ #!/usr/bin/env -S deno run --allow-read --allow-write --allow-run=cargo,git // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -import { - DenoWorkspace, - formatGitLogForMarkdown, - getGitLogFromTag, -} from "./helpers/mod.ts"; +import { DenoWorkspace } from "./deno_workspace.ts"; const workspace = await DenoWorkspace.load(); +const repo = workspace.repo; const cliCrate = workspace.getCliCrate(); const originalVersion = cliCrate.version; // increment the version -await cliCrate.increment(getVersionIncrement()); -await workspace.updateLockFile(); +await cliCrate.promptAndIncrement(); +// update the lock file +await cliCrate.cargoCheck(); // output the Releases.md markdown text console.log( @@ -21,24 +19,13 @@ console.log( ); console.log(await getReleasesMdText()); -function getVersionIncrement() { - if (confirm("Increment patch?")) { - return "patch"; - } else if (confirm("Increment minor?")) { - return "minor"; - } else if (confirm("Increment major?")) { - return "major"; - } else { - throw new Error("No decision."); - } -} - async function getReleasesMdText() { - const gitLogOutput = await getGitLogFromTag( - DenoWorkspace.rootDirPath, + const gitLog = await repo.getGitLogFromTags( + "upstream", `v${originalVersion}`, + undefined, ); - const formattedGitLog = formatGitLogForMarkdown(gitLogOutput); + const formattedGitLog = gitLog.formatForReleaseMarkdown(); const formattedDate = getFormattedDate(new Date()); return `### ${cliCrate.version} / ${formattedDate}\n\n` + |