Skip to content

Commit

Permalink
fix(execute.py): fixing command execution (#84)
Browse files Browse the repository at this point in the history
* fix(execute.py): fixing command execution

* Trigger
  • Loading branch information
odarotto authored and shinybrar committed Jul 18, 2024
1 parent c2b5902 commit 02e5f73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion workflow/lifecycle/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,16 @@ def command(work: Work) -> Work:
try:
assert isinstance(work.command, list), "missing command to execute"
validate.command(work.command[0])
to_run: Union[str, List[str]] = work.command
if len(to_run) == 1:
to_run = to_run[0]
is_shell = isinstance(to_run, str)
process = subprocess.run(
work.command,
to_run,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=work.timeout,
shell=is_shell, # nosec
)
# Check return code
process.check_returncode()
Expand Down

0 comments on commit 02e5f73

Please sign in to comment.