Fix recursive folder syncing reporting incorrect directories

This commit is contained in:
2022-02-16 15:57:23 -05:00
parent 00b935f1bb
commit 894f406fd2
+2 -2
View File
@@ -245,10 +245,10 @@ def sync(): # calls sshync to sync changes to the user's server
_folder_database = None
s_exit()
for _folder in _folder_database:
if Path(f"{path.expanduser('~/.password-pasture/')}{_folder[:-1]}").is_dir():
if Path(f"{path.expanduser('~')}{_folder[:-1]}").is_dir():
pass
else:
Path(f"{path.expanduser('~/.password-pasture/')}{_folder[:-1]}").mkdir(0o700, parents=True, exist_ok=True)
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 {} +')
system('find ' + directory + ' -type f -exec chmod -R 600 {} +')