Skip to content

Commit

Permalink
redefine testmo_args as list
Browse files Browse the repository at this point in the history
  • Loading branch information
derekk-nm committed Sep 25, 2024
1 parent 41f9bbf commit f7c2176
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions actions/testmo-create-resources/compose_testmo_resources_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@
fields = json.loads(args.resources_json)

for field in fields:
testmo_args = {
"resources": args.destination,
"name": field,
"type": "string",
"value": fields[field]
}
testmo_command = (["npx", "testmo", "automation:resources:add-field"] +
[f"--{k} {v}" for k, v in testmo_args.items()])
testmo_args = [
"--resources", args.destination,
"--name", field,
"--type", "string",
"--value", fields[field]
]
testmo_command = ["npx", "testmo", "automation:resources:add-field"]

# run the command and raise any exceptions
result = subprocess.run(
testmo_command,
testmo_command + testmo_args,
capture_output=True,
check=True,
cwd=pathlib.Path.cwd()
Expand Down

0 comments on commit f7c2176

Please sign in to comment.