From ef828b88a0e83d1bf042f5b197bd5d2e19b14491 Mon Sep 17 00:00:00 2001 From: Cuan Date: Wed, 16 Feb 2022 16:10:37 -0500 Subject: [PATCH] Added user-facing messages when deleting via sync --- bin/sshyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/sshyp b/bin/sshyp index 3cf06fe..c213ea5 100755 --- a/bin/sshyp +++ b/bin/sshyp @@ -225,11 +225,13 @@ def sync(): # calls sshync to sync changes to the user's server for _file in _deletion_database: if _file[:-1].endswith('/'): try: + print(f"Removing folder {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n") rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}") except FileNotFoundError: print('Folder does not exist locally.\n') else: try: + print(f"Removing entry {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n") remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}.gpg") except (FileNotFoundError, IsADirectoryError): print('File does not exist locally.\n') @@ -248,6 +250,7 @@ def sync(): # calls sshync to sync changes to the user's server if Path(f"{path.expanduser('~')}{_folder[:-1]}").is_dir(): pass else: + print(f"Adding folder {path.expanduser('~')}{_folder[:-1]}...\n") Path(f"{path.expanduser('~')}{_folder[:-1]}").mkdir(0o700, parents=True, exist_ok=True) # set permissions before uploading system('find ' + directory + ' -type d -exec chmod -R 700 {} +')