implement support of passing all exported vars to other commands #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds ability to export some variables in one command and get it from env of the another command. From user's point of view this should be expected behavior and it feels like all the commands run in the same shell script. However, internally command detects all the exports inside the script and append result of evaluation of those variables to the end of the executed script as
echo setvar foo=bar
After the command executed those
setvar
extracted and set to all other commands as a regular env.This snippet indicates the possible use-case:
In this example the first command export foo, bar and baz variables.
foo
andbar
are evaluated, butbaz
is not because it set directly byenv
. It is not clear to me if this override should be allowed, but i feel it could be a source for confusion, so for now it will keep the original (qux
) valueThe next command, i.e. "user variables" will get all those vars and will print