Skip to content

Commit

Permalink
Ignore warning lines in branch-deployment command output
Browse files Browse the repository at this point in the history
  • Loading branch information
shalabhc committed Apr 23, 2024
1 parent e1bd105 commit 5d7c40f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/deploy_pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,16 @@ def get_branch_deployment_name(project_dir):
]
)
if returncode:
print("Could not determine branch deployment", flush=True)
print("Could not determine branch deployment from output:", output, flush=True)
sys.exit(1)
for line in output:
# sometimes the cmd prints warnings in addition to the branch deployment name
if re.match('[0-9a-f]+', line):
name = line.strip()
break
else:
print("Could not determine branch deployment from output: ", output, flush=True)
sys.exit(1)
name = "".join(output).strip()
print("Deploying to branch deployment:", name, flush=True)
return name

Expand Down

0 comments on commit 5d7c40f

Please sign in to comment.