sanketbajoria / ssh2-promise

ssh with promise/async await and typescript support
https://www.npmjs.com/package/ssh2-promise
MIT License
148 stars 25 forks source link

Get the return code of an execution of a script #17

Closed benjaminpech closed 5 years ago

benjaminpech commented 6 years ago

Hi,

I'm trying to get the return code of a exec from a bash script on my server. It would be nice to have in output, both stderr and stdout to detect technical issues and the return code (eg. 0 or 1).

It's possible to do that ?

sanketbajoria commented 6 years ago

@benjaminpech Currently, it return either stdout (resolve) or stderr (reject) in promisify manner . Below is current implementation

image

Getting a return code would be difficult, but you can get the error message to detect the technical issue

sanketbajoria commented 5 years ago

as no update, hence closing this bug. Please feel free to reopen this bug, if feel otherwise