File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning][semver].
66The format of this changelog is [ a variant] [ lib9-versionning ] of [ Keep a Changelog] [ keep-changelog ] .
77New entries must be placed in a section entitled ` Unreleased ` .
88
9+ ## Unreleased
10+
11+ - Fix CLI argument parsing when using ` compile ` command to properly identify schema files
12+
913## 0.16.0 (2024-11-02)
1014
1115- BREAKING CHANGES: require Node.js 20.0.0 or above
Original file line number Diff line number Diff line change @@ -84,15 +84,16 @@ function main(): void {
8484 } else if ( values . version ) {
8585 console . info ( VERSION )
8686 } else {
87- if ( positionals . length > 1 && positionals [ 0 ] === "compile" ) {
88- positionals . pop ( )
87+ let schemaIndex = 0
88+ if ( positionals . length > 0 && positionals [ 0 ] === "compile" ) {
89+ schemaIndex = 1
8990 }
90- if ( positionals . length > 1 ) {
91- console . error ( "only one argument is expected" )
91+ if ( positionals . length > schemaIndex + 1 ) {
92+ console . error ( "only one schema argument is expected" )
9293 process . exit ( 1 )
9394 }
94- const schema = positionals . length > 0 ? positionals [ 0 ] : 0
95- const out = values . out ?? 1
95+ const schema =
96+ positionals . length > schemaIndex ? positionals [ schemaIndex ] : 0
9697 const generator = values . generator
9798 if (
9899 generator != null &&
@@ -104,13 +105,12 @@ function main(): void {
104105 console . error ( "Invalid <generator> value" )
105106 process . exit ( 1 )
106107 }
107- compileAction ( out , {
108+ compileAction ( schema , {
108109 generator,
109110 legacy : values . legacy ,
110111 lib : values . lib ,
111112 out : values . out ,
112113 pedantic : values . pedantic ,
113- schema,
114114 useClass : values [ "use-class" ] ,
115115 useGenericArray : values [ "use-generic-array" ] ,
116116 useIntEnum : values [ "use-int-enum" ] ,
You can’t perform that action at this time.
0 commit comments