Skip to content

Commit

Permalink
pass testmo command as list of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
derekk-nm committed Sep 25, 2024
1 parent 2698d99 commit 41f9bbf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions actions/testmo-create-resources/compose_testmo_resources_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,13 @@
"type": "string",
"value": fields[field]
}
testmo_command = "npx testmo automation:resources:add-field " + \
" ".join([f"--{k} {v}"
for k, v in testmo_args.items()])
testmo_command = (["npx", "testmo", "automation:resources:add-field"] +
[f"--{k} {v}" for k, v in testmo_args.items()])

# run the command and raise any exceptions
result = subprocess.run(
testmo_command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=True,
cwd=pathlib.Path.cwd(),
shell=True
cwd=pathlib.Path.cwd()
)

0 comments on commit 41f9bbf

Please sign in to comment.