Skip to content

Exit handler not being called #65

@ashish00076

Description

@ashish00076

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions