Fixed local folder deletion

This commit is contained in:
2022-02-16 00:23:48 -05:00
parent ff9241368e
commit 5178377827
2 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -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 {} +')
+4 -1
View File
@@ -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')