Closed suederade closed 8 years ago
ssh.shell(['cd ~/bom-test', 'rm -rf node_modules/', 'npm install --production'])
.pipe(gulp.dest())
will auto close the connection. Or you can try:
ssh.shell(['cd ~/bom-test', 'rm -rf node_modules/', 'npm install --production'])
.on('end', function() { ssh.close() })
.pipe(gulp.dest())
Ok thanks, I'll try that. For some reason the first one was not automatically closing the session and was just hanging.
I need to run some shell commands, but if I run
close
after the shell command, theclose
runs before the shell commands run. Is there a way to best practice for closing the connection when you are done or when the shell commands are finished?On the examples there is a
.pipe(gulp.dest())
but that is not closing the connection.ssh.shell(['cd ~/bom-test', 'rm -rf node_modules/', 'npm install --production', 'exit']);
the
npm
command doesn't finish if the connection is closed prematurely.