File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,25 +50,16 @@ export function updateChangelog(
5050
5151function main ( ) {
5252 try {
53- const { values } = parseArgs ( {
54- options : {
55- "target-version" : {
56- type : "string" ,
57- short : "t" ,
58- } ,
59- "rollback-version" : {
60- type : "string" ,
61- short : "r" ,
62- } ,
63- "new-version" : {
64- type : "string" ,
65- short : "n" ,
66- } ,
67- } ,
68- strict : true ,
69- } ) ;
53+ const options = {
54+ "target-version" : { type : "string" , short : "t" } ,
55+ "rollback-version" : { type : "string" , short : "r" } ,
56+ "new-version" : { type : "string" , short : "n" } ,
57+ } as const ;
7058
71- for ( const [ key , val ] of Object . entries ( values ) ) {
59+ const { values } = parseArgs ( { options, strict : true } ) ;
60+
61+ for ( const key of Object . keys ( options ) ) {
62+ const val = values [ key as keyof typeof values ] ;
7263 if ( val === undefined || val . trim ( ) === "" ) {
7364 throw new Error ( `Argument '--${ key } ' is required.` ) ;
7465 }
You can’t perform that action at this time.
0 commit comments