Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions scripts/releaseUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ export function getVersionChoices(currentVersion: string): VersionChoice[] {
} else if (currentAlpha) {
versionChoices.push({
title: "alpha",
value: inc("patch") + "-alpha.0",
value: inc("patch") + "-alpha.1",
});
} else if (currentBeta) {
versionChoices.push({
title: "beta",
value: inc("patch") + "-beta.0",
value: inc("patch") + "-beta.1",
});
} else if (currentRc) {
versionChoices.push({
title: "rc",
value: inc("patch") + "-rc.0",
value: inc("patch") + "-rc.1",
});
} else {
versionChoices.push({
Expand All @@ -183,11 +183,12 @@ export function updateVersion(pkgPath: string, version: string): void {
}

export async function getLatestTag(): Promise<string> {
return (await run("git", ["tag"], { stdio: "pipe" })).stdout
.split(/\n/)
.filter(Boolean)
.sort()
.reverse()[0];
// -v:refname is a descending semver sort
const result = await run("git", ["tag", "--sort=-v:refname"], {
stdio: "pipe",
});

return result.stdout.trim().split(/\n/).filter(Boolean)[0];
}

export async function logRecentCommits(): Promise<void> {
Expand Down