Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-to-zod does not exit without user keypress (when in package.json scripts) #278

Open
hongkongkiwi opened this issue Oct 31, 2024 · 2 comments

Comments

@hongkongkiwi
Copy link

There seems to be a minor bug which means that ts-to-zod does not exit until the user presses enter or a key.

This causes a problem when running from an npm or deno script and I have to do a workaround:
echo '' | deno run -A npm:ts-to-zod --all otherwise it will never exit.

This only happens when running from something else like a package.json script entry.

If this is intended behaviour, is it possible to add a flag like --exit-when-done ? Which as soon as the generation is finished it will terminate the process with a 0 error, that way we can use this non-interactively.

@tvillaren
Copy link
Collaborator

Hello @hongkongkiwi,

Indeed, I was able to reproduce with deno on my CLI.
When you write:

This only happens when running from something else like a package.json script entry.

Is it also with deno? Or do you gave the same issue with npm/yarn runs?

@hongkongkiwi
Copy link
Author

Same issue with package.json or normal cli runs from console.

You can get a workaround with my hack above using echo "" | ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants