This will add the environment definition to be sourced at the start of the runscript, meaning that variables are defined and then run there (so if we have a situation where a variable is defined it will be properly sourced, eg.)
%appenv foo
VARIABLE1=$VARIABLE2
export VARIABLE2
In the case of having the python read this text and then set in the environment, we would have a hard time parsing what VARIABLE2 is We also want to be able to handle the user passing in custom variables at runtime, so instead we add these lines to the top of the runscript (during runtime), eg given this runscript
This seems like a reasonable solution for now - the others I considered are attempting substitution (imperfect) or just adding a line to source at the top of the runscript (the equivalent of the above, but if we can add the content directly, we should do that!)
This will add the environment definition to be sourced at the start of the runscript, meaning that variables are defined and then run there (so if we have a situation where a variable is defined it will be properly sourced, eg.)
In the case of having the python read this text and then set in the environment, we would have a hard time parsing what
VARIABLE2
is We also want to be able to handle the user passing in custom variables at runtime, so instead we add these lines to the top of the runscript (during runtime), eg given this runscriptThe final script would be:
This seems like a reasonable solution for now - the others I considered are attempting substitution (imperfect) or just adding a line to source at the top of the runscript (the equivalent of the above, but if we can add the content directly, we should do that!)