From 61bafd4b548039566554b01b96bc511a69572469 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 20 May 2020 07:11:12 +0200 Subject: [PATCH] Fix file mode and bad variable --- prepare_remote_script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepare_remote_script.py b/prepare_remote_script.py index 600002a..20429fe 100755 --- a/prepare_remote_script.py +++ b/prepare_remote_script.py @@ -115,7 +115,7 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: def stringify_hunk(hunk): result = '' for cmd in hunk: - global host + host = 'unknown' result += f'SSH: {cmd.user}@{host} {cmd.directory} $ {cmd.command}\n' return result @@ -176,7 +176,7 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: def run_command(cmd: Command): # Save the SSH command. global target_filename - with open(target_filename, "w+") as target: + with open(target_filename, "a+") as target: target.write(f"{cmd.user if cmd.user else ''}\t{cmd.directory if cmd.directory else ''}\t{cmd.command}\n")