aboutsummaryrefslogtreecommitdiff
path: root/scripts/index-genenetwork
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-06-12 17:37:40 +0300
committerBonfaceKilz2024-06-12 19:21:50 +0300
commitf34550b5a1fd3158d1a0662f65d4501ebfc6e4d5 (patch)
tree9566fc5a9cef6d61aa2a9259bcacac685711ce32 /scripts/index-genenetwork
parente33d767b76f8f85f7735419cc748a2d1019855fc (diff)
downloadgenenetwork3-f34550b5a1fd3158d1a0662f65d4501ebfc6e4d5.tar.gz
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 <me@bonfacemunyoki.com>
Diffstat (limited to 'scripts/index-genenetwork')
-rwxr-xr-xscripts/index-genenetwork9
1 files changed, 6 insertions, 3 deletions
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.")