Handle ssh process exit codes

Change-type: patch
This commit is contained in:
Paulo Castro
2020-03-31 13:43:58 +01:00
parent 43b1c5c24f
commit a74f0413df
4 changed files with 71 additions and 12 deletions

View File

@ -28,7 +28,7 @@ export async function performLocalDeviceSSH(
opts: DeviceSSHOpts,
): Promise<void> {
const reduce = await import('lodash/reduce');
const { whichSpawn } = await import('../helpers');
const { spawnSshAndExitOnError } = await import('../ssh');
const { ExpectedError } = await import('../../errors');
const { stripIndent } = await import('common-tags');
const { isatty } = await import('tty');
@ -107,7 +107,7 @@ export async function performLocalDeviceSSH(
command = `${deviceContainerEngineBinary} exec -i ${ttyFlag} ${containerId} ${shellCmd}`;
}
return whichSpawn('ssh', [
return spawnSshAndExitOnError([
...(opts.verbose ? ['-vvv'] : []),
'-t',
...['-p', opts.port ? opts.port.toString() : '22222'],