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,11 @@ 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+ ### Fixed
12+ - Correct CLI argument parsing when using ` compile ` command to properly identify schema files
13+
914## 0.17.0 (2025-05-03)
1015
1116This version of the CLI has a [ bug] ( https://github.com/bare-ts/bare/issues/2 ) that causes the CLI to fail.
Original file line number Diff line number Diff line change @@ -83,15 +83,17 @@ function main(): void {
8383 } else if ( values . version ) {
8484 console . info ( packageVersion )
8585 } else {
86- if ( positionals . length > 1 && positionals [ 0 ] === "compile" ) {
87- positionals . pop ( )
86+ let schemaIndex = 0
87+
88+ if ( positionals . length > 0 && positionals [ 0 ] === "compile" ) {
89+ schemaIndex = 1
8890 }
89- if ( positionals . length > 1 ) {
90- console . error ( "only one argument is expected" )
91+ if ( positionals . length > schemaIndex + 1 ) {
92+ console . error ( "only one schema argument is expected" )
9193 process . exit ( 1 )
9294 }
93- const schema = positionals . length > 0 ? positionals [ 0 ] : 0
94- const out = values . out ?? 1
95+ const schema =
96+ positionals . length > schemaIndex ? positionals [ schemaIndex ] : 0
9597 const generator = values . generator
9698 if (
9799 generator != null &&
@@ -103,13 +105,12 @@ function main(): void {
103105 console . error ( "Invalid <generator> value" )
104106 process . exit ( 1 )
105107 }
106- compileAction ( out , {
108+ compileAction ( schema , {
107109 generator,
108110 legacy : values . legacy ,
109111 lib : values . lib ,
110112 out : values . out ,
111113 pedantic : values . pedantic ,
112- schema,
113114 useClass : values [ "use-class" ] ,
114115 useGenericArray : values [ "use-generic-array" ] ,
115116 useIntEnum : values [ "use-int-enum" ] ,
You can’t perform that action at this time.
0 commit comments