File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ fix: fix npx --input url error
Original file line number Diff line number Diff line change @@ -106,11 +106,12 @@ npm run openapi
106106### NPX
107107
108108``` bash
109- # npm
110109npx --package=openapi-ts-request -- openapi -i ./openapi.json -o ./apis
110+ npx --package=openapi-ts-request -- openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
111111
112112# pnpm
113- pnpm --package=openapi-ts-request dlx openapi -i ./openapi.json -o ./apis
113+ pnpm --package=openapi-ts-request@latest dlx openapi -i ./openapi.json -o ./apis
114+ pnpm --package=openapi-ts-request@latest dlx openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
114115```
115116
116117### CLI
Original file line number Diff line number Diff line change @@ -108,9 +108,11 @@ npm run openapi
108108``` bash
109109# npm
110110npx --package=openapi-ts-request -- openapi -i ./openapi.json -o ./apis
111+ npx --package=openapi-ts-request -- openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
111112
112113# pnpm
113- pnpm --package=openapi-ts-request dlx openapi -i ./openapi.json -o ./apis
114+ pnpm --package=openapi-ts-request@latest dlx openapi -i ./openapi.json -o ./apis
115+ pnpm --package=openapi-ts-request@latest dlx openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
114116```
115117
116118### CLI
Original file line number Diff line number Diff line change @@ -56,8 +56,13 @@ const params = program
5656 . opts ( ) ;
5757
5858function getPath ( path : string ) {
59- const cwd = process . cwd ( ) ;
60- return join ( cwd , path ) ;
59+ const isUrl = path . startsWith ( 'http' ) ;
60+
61+ if ( isUrl ) {
62+ return path ;
63+ }
64+
65+ return join ( process . cwd ( ) , path ) ;
6166}
6267
6368async function run ( ) {
You can’t perform that action at this time.
0 commit comments