fix: 修复windows下无法执行第二条命令的bug

This commit is contained in:
xiaojunnuo
2024-09-05 00:04:31 +08:00
parent d5bfcdb6de
commit 71ac8aae4a
2 changed files with 42 additions and 16 deletions
@@ -40,9 +40,11 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
const { script, accessId } = this;
const connectConf = await this.accessService.getById(accessId);
const sshClient = new SshClient(this.logger);
await sshClient.shell({
const scripts = script.split('\n');
await sshClient.exec({
connectConf,
script,
script: scripts,
});
// this.logger.info('exec res:', ret);
}