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

Running CLI when no TTY #666

Closed
probins opened this issue Aug 15, 2017 · 5 comments
Closed

Running CLI when no TTY #666

probins opened this issue Aug 15, 2017 · 5 comments
Labels
bug Confirmed bug

Comments

@probins
Copy link
Contributor

probins commented Aug 15, 2017

I'm trying to convert my existing babel with preset commands on GitLab Pages CI to the new minify, but am running into problems because there's no TTY on the Docker runner the CI uses. I find a related issue which states that 'There is no tty with Gitlab CI'. This means that process.stdin.isTTY is always false (see simple test), and cli.js runs runStdin() which fails because there are file params.

I can for the moment continue to use babel/preset, but I think it would be better if minify could handle this situation, perhaps by adding an option to bypass the TTY check if running in this sort of environment?

@boopathi
Copy link
Member

Would it make sense for a CLI if providing files overrides stdin? Right now the first thing the CLI tries to do is to find if it can read from stdin via process.stdin.isTTY.

What does other CLIs used in CI environments do in this situation?

@boopathi boopathi added the bug Confirmed bug label Aug 15, 2017
@probins
Copy link
Contributor Author

probins commented Aug 15, 2017

yes, I think it would make sense to check files first, then tty, then help. I've not come across this issue before (it took me quite a while to work out the cause), and I'm not sure how widespread it might be.

@boopathi
Copy link
Member

Thanks! Yeah. I think it'd be least surprising one. Would you like to send a PR for the same?

@probins
Copy link
Contributor Author

probins commented Aug 16, 2017

I can change the code and do my own tests, and then create a PR based on that. But you probably want to add some tests for this, and I see you use yarn and other things I'm not familiar with. So it's probably more efficient for you (or someone else who's familiar with the project) to make the change rather than me having to spend time familiarising myself with your set-up just for this smallish change. (Not trying to get out of doing things, but ... :-))

@j-f1
Copy link
Contributor

j-f1 commented Aug 16, 2017

@probins Consider this an excuse to learn about Yarn, then. 😄

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

No branches or pull requests

3 participants