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")