From 71585770ebc3623976ab5a7e6270779d38bd4779 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 11 Oct 2022 09:10:31 -0400 Subject: [PATCH] Fixed renaming folders and receiving false error messages when renaming entries in offline mode --- lib/sshyp.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index e563aae..f487b64 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -604,16 +604,14 @@ def rename(): # renames an entry or folder s_exit(1) if _entry_name.endswith('/'): move(f"{directory}{_entry_name}", f"{directory}{_new_name}") - system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"mkdir -p '{directory_ssh}" - f"{_new_name}'\"") + if ssh_error != 1: + system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"mkdir -p " + f"'{directory_ssh}{_new_name}'\"") else: move(f"{directory}{_entry_name}.gpg", f"{directory}{_new_name}.gpg") if ssh_error != 1: system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"cd /bin; python -c " f"'import sshypRemote; sshypRemote.delete(\"'\"{_entry_name}\"'\", 'remotely')'\"") - else: - from sshypRemote import delete as offline_delete - offline_delete(_entry_name, '') def edit(): # edits the contents of an entry