1
0
Fork 0

Fix file mode and bad variable

master
LEdoian 4 years ago
parent 5f60ef7ca3
commit 61bafd4b54

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

Loading…
Cancel
Save