File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,14 @@ export default async function githubMain(args: Argv) {
19
19
const cwd = resolve ( args . dir || "" ) ;
20
20
process . chdir ( cwd ) ;
21
21
22
- const [ action , ..._versions ] = args . _ ;
23
- if ( action !== "release" || _versions . length === 0 ) {
22
+ const [ subCommand , ..._versions ] = args . _ ;
23
+ if ( subCommand !== "release" ) {
24
24
consola . log (
25
- "Usage: changelogen gh release <versions| all> [--dir] [--token]"
25
+ "Usage: changelogen gh release [ all|versions...] [--dir] [--token]"
26
26
) ;
27
27
process . exit ( 1 ) ;
28
28
}
29
29
30
- let versions = [ ..._versions ] . map ( ( v ) => v . replace ( / ^ v / , "" ) ) ;
31
-
32
30
const config = await loadChangelogConfig ( cwd , { } ) ;
33
31
34
32
if ( config . repo ?. provider !== "github" ) {
@@ -58,6 +56,7
62A6
@@ export default async function githubMain(args: Argv) {
58
56
59
57
const changelogReleases = parseChangelogMarkdown ( changelogMd ) . releases ;
60
58
59
+ let versions = [ ..._versions ] . map ( ( v ) => v . replace ( / ^ v / , "" ) ) ;
61
60
if ( versions [ 0 ] === "all" ) {
62
61
versions = changelogReleases . map ( ( r ) => r . version ) . sort ( ) ;
63
62
} else if ( versions . length === 0 ) {
You can’t perform that action at this time.
0 commit comments