Skip to content

Fix stdin probing on Linux - #90

Merged
rstacruz merged 1 commit into
js2coffee:masterfrom
nilbus:linux-stdin
Oct 15, 2011
Merged

Fix stdin probing on Linux#90
rstacruz merged 1 commit into
js2coffee:masterfrom
nilbus:linux-stdin

Conversation

@nilbus

@nilbus nilbus commented Sep 20, 2011

Copy link
Copy Markdown
Contributor

Fixes #54

Since Linux doesn't throw EAGAIN when stdin is not ready,
we can instead probe to see if stdin is a not a tty (has a pipe).
When there is nothing on stdin and no files are given, print the
usage instructions.

I'm not sure how I would go about testing this without making the test suite hang (on stdin) when it's not working.

Fixes js2coffee#54

Since linux doesn't throw EAGAIN when stdin is not ready,
we can instead probe to see if stdin is a not a tty (has a pipe).
When there is nothing on stdin and no files are given, print the
usage instructions.
@nilbus

nilbus commented Sep 20, 2011

Copy link
Copy Markdown
Contributor Author

Also confirmed to work on OSX

@rstacruz

Copy link
Copy Markdown
Member

Thank you, sir.

@rstacruz
rstacruz merged commit 014cafa into js2coffee:master Oct 15, 2011
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

Successfully merging this pull request may close these issues.

commands don't work correctly on ubuntu

2 participants