Skip to content

Instantly share code, notes, and snippets.

@KazChe
Created March 1, 2014 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KazChe/9288896 to your computer and use it in GitHub Desktop.
Save KazChe/9288896 to your computer and use it in GitHub Desktop.
var terminal = require('child_process').spawn('cmd');
terminal.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
terminal.on('exit', function (code) {
console.log('child process exited with code ' + code);
});
setTimeout(function() {
console.log('Sending stdin to terminal');
terminal.stdin.write('mvn clean install -f /svn-checkout/<SOME_APP>/pom.xml\n');
console.log('Ending terminal session');
terminal.stdin.end();
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment