Hey there dear people! :slightly_smiling_face: ver...
# general
p
Hey there dear people! 🙂 very quick question, I defined an evironment variable in my BUILD file for my package this way:
Copy code
pex_binary(
    name="bin",
    entry_point="main.py",
    env={"VAR_NAME": "var_value"},
)
Is it possible to pass this (or override this) at runtime when I run
pants package path/to/package:bin
instead of defining it in the BUILD? Thanks so much! 🙏 Something like
pants package --env VAR_NAME=my_new_var_value path/to/package:bin
? tried to look for it but it doesn't seem to exist
1
c
Example:
Copy code
pex_binary(
    name="bin",
    entry_point="main.py",
    env={"VAR_NAME": env("VAR_NAME", "var_value")},
)
if you want to keep what you have now, but add the possibility to override from the command line
VAR_NAME=new_value pants package path/to:bin
❤️ 1
p
Works like a charm! always a life saver thanks so much dear @curved-television-6568! 🙏
👍 1