From 7e12d89db79aeb3be42429f76520008db406b745 Mon Sep 17 00:00:00 2001 From: rapcmia <73840223+rapcmia@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:35:34 +0800 Subject: [PATCH] Update add_authemail.py --- helpers/add_authemail.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helpers/add_authemail.py b/helpers/add_authemail.py index 3096871..39b8bc0 100755 --- a/helpers/add_authemail.py +++ b/helpers/add_authemail.py @@ -10,17 +10,16 @@ if len(new_email) == 0: print("\nNo email added, please try again!\n") exit() - # load the YAML file yaml_file = "../credentials.yml" with open(yaml_file, "r") as file: data = yaml.safe_load(file) -# update the admin password on credentials.yml +# append the email address to credentials.yml data["preauthorized"]["emails"].append(new_email) # write the updated data back to the file with open(yaml_file, "w") as file: yaml.dump(data, file, Dumper=yaml.RoundTripDumper) -print("Email has been added") +print("Email has been successfully added!")