Extract active environment name within script

I am not sure if there is a better solution, but I would just create a new environment variable, like environmentName=production and reference that in scripts.

It is probably the easiest way. Hope this helps!