updated config while loop to work when secrets files is removed

This commit is contained in:
crp3844
2022-09-07 15:16:14 -04:00
parent de32b4c6e6
commit d11baaff9c

View File

@@ -396,21 +396,22 @@ if __name__ == "__main__":
if opts.config:
if not does_file_exist(secrets_config_file):
print("No Bitwarden accounts found, do you want to make a new one?")
print("n) New account")
print("q) Quit config")
while True:
user_input = input("n/q> ")
if user_input.casefold() == "n":
account_details = ask_for_account_details()
write_config_file(account_details, secrets_config_file)
break
elif user_input.casefold() == "q":
sys.exit(0)
else:
print("This value must be one of the following characters: n, q.")
while True:
if not does_file_exist(secrets_config_file):
print("No Bitwarden accounts found, do you want to make a new one?")
print(" ")
print("n) New account")
print("q) Quit config")
while True:
user_input = input("n/q> ")
if user_input.casefold() == "n":
account_details = ask_for_account_details()
write_config_file(account_details, secrets_config_file)
break
elif user_input.casefold() == "q":
sys.exit(0)
else:
print("This value must be one of the following characters: n, q.")
accounts = read_config_file(secrets_config_file)
print(accounts)
print("Current Bitwarden accounts:")