From f65adc17f312a1fefcbb32201d506df0e0cd5855 Mon Sep 17 00:00:00 2001 From: Cuan Date: Wed, 16 Feb 2022 01:13:35 -0500 Subject: [PATCH] Actually fixed local folder deletion this time --- bin/sshyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/sshyp b/bin/sshyp index 78959ea..0a6a4ac 100755 --- a/bin/sshyp +++ b/bin/sshyp @@ -221,7 +221,7 @@ def sync(): # calls sshync to sync changes to the user's server _deletion_database = None s_exit() for _file in _deletion_database: - if _file.endswith('/'): + if _file[:-1].endswith('/'): try: rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}") except FileNotFoundError: @@ -229,7 +229,7 @@ def sync(): # calls sshync to sync changes to the user's server else: try: remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}") - except FileNotFoundError: + except (FileNotFoundError, IsADirectoryError): print('File does not exist locally.\n') # set permissions before uploading system('find ' + directory + ' -type d -exec chmod -R 700 {} +')