From f34550b5a1fd3158d1a0662f65d4501ebfc6e4d5 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 12 Jun 2024 17:37:40 +0300 Subject: Return 0 if data changes, else exit with 1. * scripts/index-genenetwork (is_data_modified): Replace click.echo with the respective sys.exit call. Signed-off-by: Munyoki Kilyungi --- scripts/index-genenetwork | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/index-genenetwork b/scripts/index-genenetwork index f79bfc1..9a5bd88 100755 --- a/scripts/index-genenetwork +++ b/scripts/index-genenetwork @@ -459,9 +459,12 @@ def is_data_modified(xapian_directory: str, conn, f"CHECKSUM TABLE {', '.join(db.get_metadata('tables').decode().split())}") ]) - click.echo( - db.get_metadata("generif-checksum").decode() == hash_generif_graph(sparql_uri) and - db.get_metadata("checksums").decode() == checksums) + # Return a zero exit status code when the data has changed; + # otherwise exit with a 1 exit status code. + if (db.get_metadata("generif-checksum").decode() == hash_generif_graph(sparql_uri) and + db.get_metadata("checksums").decode() == checksums): + sys.exit(1) + sys.exit(0) @click.command(help="Index GeneNetwork data and build Xapian search index in XAPIAN_DIRECTORY.") -- cgit v1.2.3