grantila / typeconv

Convert between JSON Schema, TypeScript, GraphQL, Open API and SureType
MIT License
421 stars 8 forks source link

Executing typeconv from nmp-scripts or within bash script does not work #31

Closed sml86 closed 1 year ago

sml86 commented 1 year ago
$ npm run convert-types

> @***/***@*** convert-types
> npx typeconv -f ts -t oapi -o docs './src/**/*.ts

💡 Converted 0 types in 0 files, in 0.0s
$ npm run convert-types

> @***/***@*** convert-types
> typeconv -f ts -t oapi -o docs './src/**/*.ts

💡 Converted 0 types in 0 files, in 0.0s
RafaelRamosR commented 1 year ago

In this case a single quotation mark seems to be missing at the end.

> typeconv -f ts -t oapi -o docs './src/**/*.ts

However, something similar happens to me:

npx typeconv -f ts -t oapi -o spec 'src/api/**/*.d.ts'
💡 Converted 0 types in 0 files, in 0.0s

npx typeconv -f ts -t oapi -o spec './src/api/**/*.d.ts'
💡 Converted 0 types in 0 files, in 0.0s

It works when I do not use single quotes or use double quotes:

npx typeconv -f ts -t oapi -o spec "src/api/**/*.d.ts"
💡 Converted 38 types in 6 files, in 0.1s

npx typeconv -f ts -t oapi -o spec src/api/**/*.d.ts
💡 Converted 38 types in 6 files, in 0.1s
grantila commented 1 year ago

What OS and shell are you using?

I assume most users are either on MacOS or some Linux, in which case they probably use bash or zsh, where single quotes work as expected. On other shells, you might need other escaping. The point is to provide a string which the shell does not expand itself, but instead allow typeconv to do it.

RafaelRamosR commented 1 year ago

I'm using Window 10 x64, but I really don't find it a problem to have to use double quotes. I think this issue could be closed perfectly well.

sml86 commented 1 year ago

Thank you, used also Windows 10. Did not check with double quotes already but I'm sure, that it will work. As issue opener, I close it. Thanks again.