add path checker
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user