Skip to content

Commit

Permalink
Improve code format and messages to the user
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Jan 19, 2024
1 parent 60e49a7 commit af0b27f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,17 @@ def generate_source_repository_uri(args):
git_remote = out.decode().split('\n')[0]
if org_repo not in git_remote:
# Handle the special case for citadel ignition repositories
if org_repo.replace("/ignition-", "/gz-") not in git_remote:
if org_repo.replace('/ignition-', '/gz-') not in git_remote:
print(f""" !! Automatic calculation of the source repository URI\
failed with different information:\
\n * git remote origin in the local direcotry is: {git_remote}\
\n * Package name generated org/repo: {org_repo}\
\n >> Please use --source-repo-uri parameter""")
sys.exit(1)
else:
print(f' ~ Ignition found in generated org/repo assuming a gz repo ')
org_repo = org_repo.replace("/ignition-", "/gz-")
org_repo = org_repo.replace('/ignition-', '/gz-')
print(' ~ Ignition found in generated org/repo assuming gz repo: '
+ org_repo)

# Always use github.com
return f"https://github.com/{org_repo}.git" # NOQA
Expand Down

0 comments on commit af0b27f

Please sign in to comment.