From 5178377827c77e0943c9572f287829b1d4c3a464 Mon Sep 17 00:00:00 2001 From: Cuan Date: Wed, 16 Feb 2022 00:23:48 -0500 Subject: [PATCH] Fixed local folder deletion --- bin/sshyp | 6 +++--- bin/sshyp-shear.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/sshyp b/bin/sshyp index c028f60..78959ea 100755 --- a/bin/sshyp +++ b/bin/sshyp @@ -158,7 +158,7 @@ def print_info(): # prints help text based on argument print('/ /') print('/ sshyp Copyright (C) 2021-2022 Randall Winkhart /') print('/ /') - print('/ Version 2022.02.16.fr4 /') + print('/ Version 2022.02.16.fr4.1 /') print('/ The High-Tech Shears Update /') print('/ /') print('////////////////////////////////////////////////////////\n') @@ -225,12 +225,12 @@ def sync(): # calls sshync to sync changes to the user's server try: rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}") except FileNotFoundError: - print('\nFolder does not exist locally.\n') + print('Folder does not exist locally.\n') else: try: remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}") except FileNotFoundError: - print('\nFile does not exist locally.\n') + print('File does not exist locally.\n') # set permissions before uploading system('find ' + directory + ' -type d -exec chmod -R 700 {} +') system('find ' + directory + ' -type f -exec chmod -R 600 {} +') diff --git a/bin/sshyp-shear.py b/bin/sshyp-shear.py index 108a5cf..ff63f41 100755 --- a/bin/sshyp-shear.py +++ b/bin/sshyp-shear.py @@ -34,4 +34,7 @@ def check(_client_device_name): remove(f"{expanduser('~/.config/sshyp/deleted/')}{_file}") except FileNotFoundError: pass - open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '.gpg\n') + if _file.__contains__('.gpg'): + open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '.gpg\n') + else: + open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '\n')