steelbrain / node-ssh

SSH2 with Promises
MIT License
948 stars 94 forks source link

result.code is null on successful commands, used to be zero #404

Closed anttilaiti closed 3 years ago

anttilaiti commented 3 years ago

If I run a successful shell command with ssh.execCommand using node-ssh 12.0.0, the exit status in result.code becomes null. It used to be 0 at least with node-ssh 6.0.0. If I run an unsuccesful shell command, the exit status is 127 like it should.

maquak commented 3 years ago

Quite remarkable issue number: result.code Not Found :)

I think the issue is here: https://github.com/steelbrain/node-ssh/blob/main/src/index.ts#L373

steelbrain commented 3 years ago

This has been fixed in v12.0.1, thank you both!