mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 23:27:17 -04:00
Actually fixed local folder deletion this time
This commit is contained in:
@@ -221,7 +221,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
|||||||
_deletion_database = None
|
_deletion_database = None
|
||||||
s_exit()
|
s_exit()
|
||||||
for _file in _deletion_database:
|
for _file in _deletion_database:
|
||||||
if _file.endswith('/'):
|
if _file[:-1].endswith('/'):
|
||||||
try:
|
try:
|
||||||
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
@@ -229,7 +229,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, IsADirectoryError):
|
||||||
print('File 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 {} +')
|
||||||
|
|||||||
Reference in New Issue
Block a user