From c8d22f1b62b6414a47fc9f0a681170507bbf3670 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:40:30 +0100 Subject: [PATCH] Handle any strings with dollar sign as env should be interpreted --- twkit/tower.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/twkit/tower.py b/twkit/tower.py index 47329a4..7c2d6af 100644 --- a/twkit/tower.py +++ b/twkit/tower.py @@ -63,9 +63,7 @@ def _tw_run(self, cmd, *args, **kwargs): params_path = kwargs["params_file"] command.append(f"--params-file={params_path}") - full_cmd = " ".join( - arg if arg.startswith("$") else shlex.quote(arg) for arg in command - ) + full_cmd = " ".join(arg if "$" in arg else shlex.quote(arg) for arg in command) logging.debug(f" Running command: {full_cmd}\n") # Run the command and return the stdout