You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
426 B

  1. var execSh = require('../')
  2. // run interactive bash shell
  3. execSh('echo ola && bash', { cwd: '/home' }, function (err) {
  4. if (err) {
  5. console.log('Exit code: ', err.code)
  6. return
  7. }
  8. // collect streams output
  9. execSh(['bash -c id', 'echo olaola >&2'], true,
  10. function (err, stdout, stderr) {
  11. console.log('error: ', err)
  12. console.log('stdout: ', stdout)
  13. console.log('stderr: ', stderr)
  14. })
  15. })