8000 fix: allow providing no versions · unjs/changelogen@ac84c39 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit ac84c39

Browse files
committed
fix: allow providing no versions
1 parent 585594e commit ac84c39

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/commands/github.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ export default async function githubMain(args: Argv) {
1919
const cwd = resolve(args.dir || "");
2020
process.chdir(cwd);
2121

22-
const [action, ..._versions] = args._;
23-
if (action !== "release" || _versions.length === 0) {
22+
const [subCommand, ..._versions] = args._;
23+
if (subCommand !== "release") {
2424
consola.log(
25-
"Usage: changelogen gh release <versions|all> [--dir] [--token]"
25+
"Usage: changelogen gh release [all|versions...] [--dir] [--token]"
2626
);
2727
process.exit(1);
2828
}
2929

30-
let versions = [..._versions].map((v) => v.replace(/^v/, ""));
31-
3230
const config = await loadChangelogConfig(cwd, {});
3331

3432
if (config.repo?.provider !== "github") {
@@ -58,6 +56,7 62A6 @@ export default async function githubMain(args: Argv) {
5856

5957
const changelogReleases = parseChangelogMarkdown(changelogMd).releases;
6058

59+
let versions = [..._versions].map((v) => v.replace(/^v/, ""));
6160
if (versions[0] === "all") {
6261
versions = changelogReleases.map((r) => r.version).sort();
6362
} else if (versions.length === 0) {

0 commit comments

Comments
 (0)
0