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

Implemented reading scripts from stdin #6

Closed
wants to merge 1 commit into from

Conversation

odeke-em
Copy link

Fixes #1.

This PR starts the ability to read from stdin.
The main problem though is that os.Stdin is consumed
for the script body's read and EOF encountered.
This means that we won't have interactive input.

Just to let you know there is a method script.Piped() that could potentially be useful in handling the non-interactiveness after EOF on stdin is encountered.

It is currently a work in progress so that I don't forget about it. Please feel free to copy the code, discard it or modify it.

Cheers!

Review on Reviewable

@odeke-em
Copy link
Author

Sample

screen shot 2016-01-24 at 2 48 48 pm

As you can see, stdin can't be read from. A really hacky solution could be to try to re-open stdin but maybe we don't wanna do that.

@ellotheth
Copy link
Owner

Tests! I feel so ashamed!

See also ca6473d. I took a roughly similar approach, but with the file mode check.

Fixes ellotheth#1.

This PR starts the ability to read from stdin.
The main problem though is that os.Stdin is consumed
for the script body's read and EOF encountered.
This means that we won't have interactive input.
@odeke-em odeke-em force-pushed the implement-stdin-reading branch from b50d080 to 137a1d4 Compare January 24, 2016 23:36
@odeke-em
Copy link
Author

Turns out I hadn't committed my last changes as I was multi tasking abit. Please refresh and take a look.

@odeke-em
Copy link
Author

Implemented by #8. Thanks @ellotheth. I'll close this PR.

@odeke-em odeke-em closed this Mar 22, 2016
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.

2 participants