From 3d9281ebb1478f841a4e12d3b13c45ed4dc70738 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Fri, 24 May 2024 02:19:21 +1200 Subject: [PATCH] fix storage path not existing for default identity --- web.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web.py b/web.py index 18d0c1d..c4d68ad 100644 --- a/web.py +++ b/web.py @@ -1373,8 +1373,12 @@ def main(): print("Reticulum Identity <{}> has been loaded from base64.".format(identity.hash.hex())) else: + # ensure provided storage dir exists, or the default storage dir exists + base_storage_dir = args.storage_dir or os.path.join("storage") + os.makedirs(base_storage_dir, exist_ok=True) + # configure path to default identity file - default_identity_file = os.path.join("storage", "identity") + default_identity_file = os.path.join(base_storage_dir, "identity") # if default identity file does not exist, generate a new identity and save it if not os.path.exists(default_identity_file):