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 {} +')