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

Read shell scripts from STDIN #8

Merged
merged 13 commits into from
Mar 19, 2016
Merged

Read shell scripts from STDIN #8

merged 13 commits into from
Mar 19, 2016

Conversation

ellotheth
Copy link
Owner

Accept a script from STDIN. Reading from a pipe kills the interactive options (because it eats STDIN), so the behavior is different:

  • --inspect is ignored.
  • --target is ignored. Instead of running the script, pipethis will echo the contents to STDOUT (so it can be piped to the target executable, e.g. curl | pipethis | sh ).
  • Author matches must come from the user's local PGP keyring.
  • The author must match exactly one identity in the keyring.
  • The author match will be automatically selected, without input from the user.

Fixes #1. See also #6.

ellotheth and others added 9 commits March 3, 2016 21:35
If the script is coming from STDIN, ignore the --target executable and finish
by echoing the contents instead. Also disable --inspect to avoid tangling the
pipes.
If there's more than one match (or no matches), bail with an error. Piped input
means we don't get to be interactive.
Run only gets called when the script is specified on the command line (not
piped in).
@ellotheth ellotheth force-pushed the issue-1/read-from-stdin branch from b0432a7 to 2e7792d Compare March 4, 2016 04:35
Matches from the local keyring won't have usernames, and attached signatures
won't have a Source().
@ellotheth ellotheth force-pushed the issue-1/read-from-stdin branch from 57a1eff to 539631d Compare March 19, 2016 17:46
Instead of showing a zero-length list and offering nonsensical options!
@ellotheth ellotheth force-pushed the issue-1/read-from-stdin branch 3 times, most recently from 111dde3 to 345ce4c Compare March 19, 2016 18:29
@ellotheth ellotheth force-pushed the issue-1/read-from-stdin branch from 345ce4c to ee3541a Compare March 19, 2016 18:29
ellotheth added a commit that referenced this pull request Mar 19, 2016
Fixes #1: Read shell scripts from STDIN
@ellotheth ellotheth merged commit e06830b into master Mar 19, 2016
@ellotheth ellotheth deleted the issue-1/read-from-stdin branch March 19, 2016 18:47
@odeke-em
Copy link

Awesome, thanks for implementing this.

@ellotheth
Copy link
Owner Author

@odeke-em Most welcome. Thanks for your work on it too, it was helpful!

@odeke-em
Copy link

You too
realmvp

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