Skip to content

Commit aae4728

Browse files
authored
fix(chromeos): Fix node-ssh exit code interpretation (#92)
Since upgrading node-ssh, we sometimes get an exit code of 0, other times an exit code of null. This makes the tool more flexible in interpreting those codes.
1 parent c07311d commit aae4728

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backends/chromeos/chromeos-utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ async function executeRemoteCommand(log, ssh, argv) {
211211

212212
const output = await ssh.exec(executable, args, options);
213213

214-
// output.code == 0 means success.
215-
if (output.code != 0) {
214+
// output.code == 0 or output.code == null means success.
215+
const success = output.code == 0 || output.code == null;
216+
if (!success) {
216217
log.error(`Remote command ${argv.join(' ')} ` +
217218
`failed with exit code ${output.code} ` +
218219
`and full output: ${output.stdout} ${output.stderr}`);

0 commit comments

Comments
 (0)