mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
Please add capability to allow hook to read from stdin instead of /dev/tty #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nneul on GitHub (Jan 21, 2016).
Right now, the way it's written, hooks can't do normal IO then get immediate EOF.
While it's straightforward enough to run under expect/whatever, would be nice if a simple read/prompt would work.
@lukas2511 commented on GitHub (Jan 22, 2016):
I actually have no idea what you are asking for.
Hooks are just called as simple commands in the script with all data passed as arguments, there is no need to read from anywhere.
@nneul commented on GitHub (Jan 22, 2016):
In my case when testing, I was an interactive prompt in the hook (wasn't fully automated). With the way it's currently implemented, you can't read from stdin in the hook - you can only read from /dev/tty.
i.e. if you do "read x" in a hook shell script, it will immediately exit (as opposed to read x < /dev/tty which forces a read from the active terminal)
@lukas2511 commented on GitHub (Jan 22, 2016):
I see what you mean, but I'm not entirely sure why this happens...
@nneul commented on GitHub (Jan 22, 2016):
Found it. It's from this in command_sign_domains:
During the entire loop, stdin is captured. Have a pr coming.
@nneul commented on GitHub (Jan 23, 2016):
What about this implementation #110