fix issues

pull/410/head
vapao 2021-09-17 23:34:35 +08:00
parent b64342a192
commit b836148bc5
1 changed files with 3 additions and 4 deletions

View File

@ -176,11 +176,10 @@ class SSH:
return f'export {str_envs}' return f'export {str_envs}'
def _handle_command(self, command, environment): def _handle_command(self, command, environment):
commands = list() commands = command.strip('\n').splitlines()
commands.append(self._make_env_command(environment)) commands.insert(0, self._make_env_command(environment))
commands.append(command.strip('\n'))
commands.append(f'echo {self.eof} $?\n') commands.append(f'echo {self.eof} $?\n')
return '\n'.join(x for x in commands if x).encode() return ';'.join(x for x in commands if x).encode()
def __enter__(self): def __enter__(self):
self.get_client() self.get_client()