Skip to content

Commit

Permalink
fix(chromeos): Fix node-ssh exit code interpretation (#92)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joeyparrish authored May 15, 2024
1 parent c07311d commit aae4728
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backends/chromeos/chromeos-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ async function executeRemoteCommand(log, ssh, argv) {

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

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

0 comments on commit aae4728

Please sign in to comment.