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

create-countries should stop without input #44

Closed
rgaudin opened this issue Aug 23, 2024 · 3 comments · Fixed by #45
Closed

create-countries should stop without input #44

rgaudin opened this issue Aug 23, 2024 · 3 comments · Fixed by #45
Assignees
Labels
bug Something isn't working

Comments

@rgaudin
Copy link
Member

rgaudin commented Aug 23, 2024

When the script is called without any argument, there is no output and the process stalls forever.

If there is no stdin upon start, we should assume it was not piped and show an error

mirrors-qa-backend create-countries
@rgaudin rgaudin added the bug Something isn't working label Aug 23, 2024
@elfkuzco
Copy link
Collaborator

elfkuzco commented Aug 23, 2024

Um, it doesn't stall per say. Rather it waits for input which can come from stdin. It allows me to type a list of strings (even though it's not something I would do).

I imagine it to be like any of the Linux command utilities, for example cat that when invoked without a file wait for the input to arrive. It allows piping I think rather than allowing an explicit file which might not be mounted in a container.

Of course, I can always refactor it. What do you think?

@rgaudin
Copy link
Member Author

rgaudin commented Aug 23, 2024

We want our scripts to be self-documenting, especially in this context of a sub command for which there are many with similar names. Our workflow here is very far from that of core unix tools. 99% of the time, we'll have a file on filesystem to work from. We should work toward that use case first

@elfkuzco
Copy link
Collaborator

Oh, okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants