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

Add support for stdin parameters #278

Open
bugy opened this issue Mar 28, 2020 · 1 comment
Open

Add support for stdin parameters #278

bugy opened this issue Mar 28, 2020 · 1 comment

Comments

@bugy
Copy link
Owner

bugy commented Mar 28, 2020

At the moment all the parameters are passed to a script via common line arguments (e.g. my_script.sh -param1 ABC -param2 DEF)
And during script execution, a user can input text to stdin (if, for example, he is asked for some additional confirmation).

It would be nice, to have such parameters, which would be sent to stdin automatically by Script server, when, for example, special output text is detected.
E.g.

{
   "parameter": "username",
   "expected_text": "Enter your name"
}

So, when a script is executed and prints:
Enter your name, Script server will write username parameter to stdin

Some more examples of similar functionality:
https://pexpect.readthedocs.io/en/stable/overview.html

@bugy bugy added the feature label Mar 28, 2020
This was referenced Mar 28, 2020
@bugy bugy added this to the 1.18.0 milestone Sep 3, 2021
bugy added a commit that referenced this issue Mar 17, 2023
…ssing parameters as arguments/env variables
@bugy
Copy link
Owner Author

bugy commented Mar 17, 2023

Done, it's configurable via 2 options:

  • pass_as, can be one of [argument, env_variable, stdin]
  • stdin_expected_text, optional, specifies after which value the parameter should be sent. By default, the parameter is sent to stdin on script startup

@bugy bugy added the resolved label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant