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

Capture environment variables so they are available in the clipboard, specially in the if/unless conditions #177

Closed
eldipa opened this issue Jun 21, 2021 · 1 comment · Fixed by #178
Labels
enhancement something nice to have but it is not neither critical nor urgent
Milestone

Comments

@eldipa
Copy link
Collaborator

eldipa commented Jun 21, 2021

Describe the feature you'd like
byexample passes by default the environment variables to the interpreters and they are available from the examples and to the modules.

But if the user wants to use an env var to paste it in the example, she can't.

byexample also supports conditional execution based on the content (or absence of it) for a particular captured variable in the clipboard. Using an env var for this is also not supported.

The idea is then simple: make byexample to put all the environment variables in the clipboard so they can be used for pasting or for conditional execution.

Because this will probably pollute the clipboard, we could have disabled by default and enabled it from the command line with --capture-env-vars. May be we could allow a subset with --capture-env-var X.

@eldipa eldipa added the enhancement something nice to have but it is not neither critical nor urgent label Jun 21, 2021
eldipa added a commit that referenced this issue Jun 21, 2021
Add a command line argument to capture environment variables and put
them into the clipboard so they can be pasted and used in conditionals.

This capture is done per worker and preserved. Modifications to the
environment will not be reflected on purpose.

Closes #177
@eldipa
Copy link
Collaborator Author

eldipa commented Jun 21, 2021

In #178 the --capture-env-var and --capture-env-vars flags were added. Both do the same (they are aliases); they take one or more environment variables names separated with commas and capture their values into the clipboard.

The proposed "capture all the variables" was not implemented as it is not clear if we really need it.

@eldipa eldipa added this to the 10.1.0 milestone Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement something nice to have but it is not neither critical nor urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant