So, I was wondering, what if there happened to be an environment variable already named <PREFIX><Buildvar>, e.g., BHBuildSystem? What would happen? would BuildHelpers overwrite it? None of the function documentation mentioned what would happen, and I couldn't overtly see that anything would be overwritten--in fact, it looked like a check was made. But, still, what would happen? So I ran a test:
What happened to the BUILD_BuildSystem variable? It wasn't emitted. Why not? It's still there, of course:
PS C:\> Get-Item $ENV:\BUILD_BuildSystem
Local
It would be better if BuildHelpers returned all environment variables that it would set, even if BuildHelpers did not itself actually set the variable, e.g., if a variable that BuildHelpers would normally set already has a value in the environment, simply return that variable.
So, I was wondering, what if there happened to be an environment variable already named
<PREFIX><Buildvar>
, e.g.,BHBuildSystem
? What would happen? would BuildHelpers overwrite it? None of the function documentation mentioned what would happen, and I couldn't overtly see that anything would be overwritten--in fact, it looked like a check was made. But, still, what would happen? So I ran a test:What happened to the
BUILD_BuildSystem
variable? It wasn't emitted. Why not? It's still there, of course:It would be better if BuildHelpers returned all environment variables that it would set, even if BuildHelpers did not itself actually set the variable, e.g., if a variable that BuildHelpers would normally set already has a value in the environment, simply return that variable.