File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ fix: fix npx default params lose
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22import { program } from 'commander' ;
3+ import { pickBy } from 'lodash' ;
34import { join } from 'path' ;
45
56import * as pkg from '../../package.json' ;
6- import { generateService } from '../index' ;
7+ import { GenerateServiceProps , generateService } from '../index' ;
78
89const params = program
910 . name ( 'openapi' )
@@ -95,7 +96,7 @@ async function run() {
9596 const input = getPath ( params . input as string ) ;
9697 const output = getPath ( params . output as string ) ;
9798
98- await generateService ( {
99+ const options : GenerateServiceProps = {
99100 schemaPath : input ,
100101 serversPath : output ,
101102 requestLibPath : params . requestLibPath as string ,
@@ -120,7 +121,14 @@ async function run() {
120121 isOnlyGenTypeScriptType :
121122 JSON . parse ( params . isOnlyGenTypeScriptType as string ) === true ,
122123 isCamelCase : JSON . parse ( params . isCamelCase as string ) === true ,
123- } ) ;
124+ } ;
125+
126+ await generateService (
127+ pickBy (
128+ options ,
129+ ( value ) => value !== null && value !== undefined && value !== ''
130+ ) as GenerateServiceProps
131+ ) ;
124132 process . exit ( 0 ) ;
125133 } catch ( error ) {
126134 console . error ( 'this is error: ' , error ) ;
You can’t perform that action at this time.
0 commit comments