added ability to pass environment variables

This commit is contained in:
iLLiCiTiT 2021-12-16 14:56:00 +01:00
parent 0b9f9450f6
commit 5fc7307be6

View file

@ -28,6 +28,12 @@ def main(input_json_path):
with open(input_json_path, "r") as stream:
data = json.load(stream)
# Change environment variables
env = data.get("env") or {}
for key, value in env.items():
os.environ[key] = value
# Prepare launch arguments
args = data["args"]
if isinstance(args, list):
args = subprocess.list2cmdline(args)