diff --git a/api/app.py b/api/app.py index 0486cd9..c4c6335 100644 --- a/api/app.py +++ b/api/app.py @@ -29,6 +29,8 @@ password_types = [ ################################################# HASH_FILE = Path("/opt/pwdgen/hash_record.txt") # Create the file if it doesn't exist + +os.makedirs(os.path.dirname(HASH_FILE), exist_ok=True) if not HASH_FILE.exists(): HASH_FILE.touch(exist_ok=True)