Skip to content

Commit

Permalink
feat: default gh release to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 3, 2023
1 parent 7f4a05f commit 44788f5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/commands/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,19 @@ export default async function githubMain(args: Argv) {

const changelogReleases = parseChangelogMarkdown(changelogMd).releases;

if (versions.length === 1 && versions[0] === "all") {
if (versions[0] === "all") {
versions = changelogReleases.map((r) => r.version).sort();
} else if (versions.length === 0) {
if (config.newVersion) {
versions = [config.newVersion];
} else if (changelogReleases.length > 0) {
versions = [changelogReleases[0].version];
}
}

if (versions.length === 0) {
consola.error(`No versions specified to release!`);
process.exit(1);
}

for (const version of versions) {
Expand Down

0 comments on commit 44788f5

Please sign in to comment.