diff --git a/non-critical-infra/packages/encrypt-email-address/encrypt-email-address.py b/non-critical-infra/packages/encrypt-email-address/encrypt-email-address.py index 3b6c935f..5d613ae4 100755 --- a/non-critical-infra/packages/encrypt-email-address/encrypt-email-address.py +++ b/non-critical-infra/packages/encrypt-email-address/encrypt-email-address.py @@ -27,9 +27,10 @@ def main(id: str, email: str, force: bool) -> None: ) # Make sure we aren't being given a text file that happens to have a newline at the end. - if email.endswith("\n"): - click.secho("Removing trailing newline from email address", fg="yellow") - email = email.removesuffix("\n") + clean_email = email.strip() + if clean_email != email: + click.secho("Removed whitespace surrounding given email address", fg="yellow") + email = clean_email if Path.cwd().name != "non-critical-infra": raise click.ClickException(