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
106
106
### NPX
107
107
108
108
``` bash
109
- # npm
110
109
npx --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
111
111
112
112
# 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
114
115
```
115
116
116
117
### CLI
Original file line number Diff line number Diff line change @@ -108,9 +108,11 @@ npm run openapi
108
108
``` bash
109
109
# npm
110
110
npx --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
111
112
112
113
# 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
114
116
```
115
117
116
118
### CLI
Original file line number Diff line number Diff line change @@ -56,8 +56,13 @@ const params = program
56
56
. opts ( ) ;
57
57
58
58
function 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 ) ;
61
66
}
62
67
63
68
async function run ( ) {
You can’t perform that action at this time.
0 commit comments