mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 12:56:28 -04:00
Added user-facing messages when deleting via sync
This commit is contained in:
@@ -225,11 +225,13 @@ def sync(): # calls sshync to sync changes to the user's server
|
||||
for _file in _deletion_database:
|
||||
if _file[:-1].endswith('/'):
|
||||
try:
|
||||
print(f"Removing folder {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n")
|
||||
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
|
||||
except FileNotFoundError:
|
||||
print('Folder does not exist locally.\n')
|
||||
else:
|
||||
try:
|
||||
print(f"Removing entry {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n")
|
||||
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}.gpg")
|
||||
except (FileNotFoundError, IsADirectoryError):
|
||||
print('File does not exist locally.\n')
|
||||
@@ -248,6 +250,7 @@ def sync(): # calls sshync to sync changes to the user's server
|
||||
if Path(f"{path.expanduser('~')}{_folder[:-1]}").is_dir():
|
||||
pass
|
||||
else:
|
||||
print(f"Adding folder {path.expanduser('~')}{_folder[:-1]}...\n")
|
||||
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 {} +')
|
||||
|
||||
Reference in New Issue
Block a user