mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-06 09:07:13 -04:00
Fixed local folder deletion
This commit is contained in:
@@ -158,7 +158,7 @@ def print_info(): # prints help text based on argument
|
|||||||
print('/ /')
|
print('/ /')
|
||||||
print('/ sshyp Copyright (C) 2021-2022 Randall Winkhart /')
|
print('/ sshyp Copyright (C) 2021-2022 Randall Winkhart /')
|
||||||
print('/ /')
|
print('/ /')
|
||||||
print('/ Version 2022.02.16.fr4 /')
|
print('/ Version 2022.02.16.fr4.1 /')
|
||||||
print('/ The High-Tech Shears Update /')
|
print('/ The High-Tech Shears Update /')
|
||||||
print('/ /')
|
print('/ /')
|
||||||
print('////////////////////////////////////////////////////////\n')
|
print('////////////////////////////////////////////////////////\n')
|
||||||
@@ -225,12 +225,12 @@ def sync(): # calls sshync to sync changes to the user's server
|
|||||||
try:
|
try:
|
||||||
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print('\nFolder does not exist locally.\n')
|
print('Folder does not exist locally.\n')
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print('\nFile does not exist locally.\n')
|
print('File does not exist locally.\n')
|
||||||
# set permissions before uploading
|
# set permissions before uploading
|
||||||
system('find ' + directory + ' -type d -exec chmod -R 700 {} +')
|
system('find ' + directory + ' -type d -exec chmod -R 700 {} +')
|
||||||
system('find ' + directory + ' -type f -exec chmod -R 600 {} +')
|
system('find ' + directory + ' -type f -exec chmod -R 600 {} +')
|
||||||
|
|||||||
@@ -34,4 +34,7 @@ def check(_client_device_name):
|
|||||||
remove(f"{expanduser('~/.config/sshyp/deleted/')}{_file}")
|
remove(f"{expanduser('~/.config/sshyp/deleted/')}{_file}")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
if _file.__contains__('.gpg'):
|
||||||
open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '.gpg\n')
|
open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '.gpg\n')
|
||||||
|
else:
|
||||||
|
open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user