555
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.

elxr 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env node
  2. var ENV = Object.assign({}, process.env); // Shallow clone it.
  3. const spawn = require('child_process').spawn;
  4. console.dir(process.argv.slice(2))
  5. const child = spawn(
  6. (process.platform === 'win32' ? 'npm.cmd' : 'npm')
  7. , ['run', 'index', '--'].concat(process.argv.slice(2)), { env : Object.assign({}, process.env, {wd: process.cwd()}), cwd: __dirname });
  8. // const child = spawn(
  9. // 'C:\\Program Files\\Git\\bin\\sh.exe'
  10. // , ['notepad', 'index'], { cwd: __dirname });
  11. // ENV.FORCE_COLOR = true;
  12. // const child = spawn(
  13. // 'node'
  14. // , ['../index.js', 'pull'], { env : ENV, cwd: __dirname });
  15. process.stdin.pipe(child.stdin)
  16. child.stdout.pipe(process.stdout)
  17. child.stderr.pipe(process.stderr)
  18. // started.stdout.on('data', function (data) {
  19. // console.log('stdout:', data.toString());
  20. // });
  21. // started.stderr.on('data', function (data) {
  22. // console.log('stderr:', data.toString());
  23. // });
  24. // started.on('exit', function (code) {
  25. // console.log('child process exited with code:', code.toString());
  26. // });