contrib: have apiage fail if no source data is available

It is kind of pointless to let the tool run if no source data is
present, so treat empty/missing source as an error.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-10-11 10:30:50 -04:00 committed by mergify[bot]
parent 0d5ae4da1f
commit 689ee58bf8
1 changed files with 6 additions and 0 deletions

View File

@ -278,6 +278,12 @@ def main():
api_src = read_json(cli.source) if cli.source else {}
api_tracked = read_json(cli.current) if cli.current else {}
if not api_src:
print(
f"error: no source data found (path: {cli.source})", file=sys.stderr
)
sys.exit(1)
if cli.current_tag:
tag_to_versions(cli, cli.current_tag)