From 6cab1b4573f200ce2fb29309ef6c3150221a1690 Mon Sep 17 00:00:00 2001 From: crp3844 Date: Thu, 8 Sep 2022 15:43:20 -0400 Subject: [PATCH] added message to create accounts if none exist --- bitwardenBackup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitwardenBackup.py b/bitwardenBackup.py index 1c9ef01..dc0002f 100644 --- a/bitwardenBackup.py +++ b/bitwardenBackup.py @@ -15,6 +15,7 @@ from kmip.pie import client os_detected = platform.system() script_directory = os.path.dirname(os.path.realpath(__file__)) +script_name = os.path.basename(__file__) secrets_config_file = os.path.join(script_directory, "secrets.config") pykmip_client_config_file = os.path.join(script_directory, "conf", "client.conf") log_file = os.path.join(script_directory, "log.log") @@ -423,6 +424,9 @@ if __name__ == "__main__": print("This value must be one of the following characters: e, n, d, q.") #json.loads((subprocess.check_output(['bw.exe','status'])).decode())['status'] + if not does_file_exist(secrets_config_file): + print("No configuration file found. Please run {} -c to configure your accounts.".format(script_name)) + sys.exit(-1) accounts = read_config_file(secrets_config_file) emails = list(accounts) for email in emails: