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