Commit 975ee495 authored by tskluzac's avatar tskluzac
Browse files

black/flake8. Tested and functional on both Intel and M1 Macbooks.

parent d444180c
Pipeline #264333 passed with stage
in 31 seconds
......@@ -43,7 +43,8 @@ activity = ShellActivity(
"a.gif",
],
logger=logger,
env_vars=[('PATH', '$PATH:/opt/homebrew/bin')]
# Uncomment if running on M1 Mac.
env_vars=[("PATH", "$PATH:/opt/homebrew/bin")],
)
campaign.add_activity(activity)
......
......@@ -46,7 +46,7 @@ class ShellActivity(Activity):
)
# Pull out environment variables, IF users submitted them.
if 'env_vars' in kwargs:
if "env_vars" in kwargs:
self.env_vars = kwargs.get("env_vars")
else:
self.env_vars = None
......@@ -55,5 +55,11 @@ class ShellActivity(Activity):
return {
"plugin": "shell",
"files": self.files,
"cmd": {"bash": {"program": self.command, "args": self.arguments, "env_vars": self.env_vars}},
"cmd": {
"bash": {
"program": self.command,
"args": self.arguments,
"env_vars": self.env_vars,
}
},
}
......@@ -81,7 +81,8 @@ class Shell(Plugin):
cmd = data["bash"]["args"]
cmd.insert(0, data["bash"]["program"])
# Take an image of the parent environment -- then add the environment variables to it.
# Take an image of the parent environment
# -- then add the environment variables to it.
parent_env = os.environ.copy()
try:
......@@ -91,7 +92,7 @@ class Shell(Plugin):
except ValueError as e:
self._logger.error(f"Caught ValueError: {e}")
shell_cmd = ' '.join(cmd)
shell_cmd = " ".join(cmd)
self._logger.debug(f"Running SHELL command: {shell_cmd}")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment