aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-05-22 10:19:42 +0300
committerFrederick Muriuki Muriithi2023-05-22 10:20:57 +0300
commitcb52df1c320463674938462a68e0a3be4279473b (patch)
treed9250ff1d370a447d480841e6a9b3fe62292b69e
parent2df4c10b0d4bcab6370946b7c258ab09c18c7a7f (diff)
downloadgenenetwork3-cb52df1c320463674938462a68e0a3be4279473b.tar.gz
Make directory at "path" and all intermediate ones.
Make the directory at the given path, and any intermediate ones to avoid errors in the indexing code when the directory, or its parent(s) do not exist.
-rwxr-xr-xscripts/index-genenetwork2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/index-genenetwork b/scripts/index-genenetwork
index 401ae1a..4da82e4 100755
--- a/scripts/index-genenetwork
+++ b/scripts/index-genenetwork
@@ -131,6 +131,8 @@ def locked_xapian_writable_database(path: pathlib.Path) -> xapian.WritableDataba
between processes.
"""
# pylint: disable-next=invalid-name
+ if not path.exists():
+ os.makedirs(path)
db = xapian.WritableDatabase(str(path))
db.begin_transaction()
try: