Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit handler not being called #65

Open
ashish00076 opened this issue Oct 23, 2018 · 0 comments
Open

Exit handler not being called #65

ashish00076 opened this issue Oct 23, 2018 · 0 comments

Comments

@ashish00076
Copy link

In exec options, I've added 3 handlers - out, err, exit.
The out and err handlers get called successfully, however, the exit handler that is supposed to provide concatenated result doesn't get called at all.

My code is as follows -

`
//ssh to remote machine
ssh.exec(shellCommand, {

	out: function(stdout) {
		let successData = stdout.toString('utf8') || "Script executed successfully";
		console.log(successData);
	},
	exit: function(code,stdout,stderr) {
		console.log(stdout);
	} ,
	err: function(stderr) {
		let errorData = stderr.toString('utf8') || "Error in script execution";							
		console.log(errorData);
	}

}).start();

`

Please let me know if there's anything wrong with the above code, or as how to invoke the exit handler.

Regards,
Ashish Deshpande

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant