|
|
@@ -1,16 +1,30 @@ |
|
|
|
#!/usr/bin/env node |
|
|
|
|
|
|
|
var ENV = Object.assign({}, process.env); // Shallow clone it. |
|
|
|
|
|
|
|
// var env = Object.assign(ENV, process.env, {wd: process.cwd(), cwd: __dirname, FORCE_COLOR : 'true', NPM_CONFIG_COLOR : 'always' }) |
|
|
|
var env = Object.assign({}, process.env, {wd: process.cwd() |
|
|
|
, FORCE_COLOR : 'true', NPM_CONFIG_COLOR : 'always' |
|
|
|
}) |
|
|
|
// console.dir(env) |
|
|
|
|
|
|
|
const spawn = require('child_process').spawn; |
|
|
|
console.dir(process.argv.slice(2)) |
|
|
|
// console.dir(process.argv.slice(2)) |
|
|
|
|
|
|
|
|
|
|
|
let npmcmd = (process.platform === 'win32' ? 'npm.cmd' : 'npm') |
|
|
|
let npmrun = (process.platform === 'win32' ? ['run', 'index', '--'] : ['run', 'index_linux', '--']) |
|
|
|
let npmrun = (process.platform === 'win32' ? [ '--color=always', 'run', 'index', '--'] : ['run', 'index_linux', '--']) |
|
|
|
// let npmcmd = 'node' |
|
|
|
// let npmrun = (process.platform === 'win32' ? [ '../index', '--'] : ['run', 'index_linux', '--']) |
|
|
|
|
|
|
|
|
|
|
|
const child = spawn( |
|
|
|
npmcmd |
|
|
|
, npmrun.concat(process.argv.slice(2)), { env : Object.assign({}, process.env, {wd: process.cwd()}), cwd: __dirname }); |
|
|
|
, npmrun.concat(process.argv.slice(2)), { |
|
|
|
env, cwd: __dirname |
|
|
|
, stdio: ['pipe', process.stdout, process.stderr], |
|
|
|
inherit: true, |
|
|
|
shell: true, |
|
|
|
}); |
|
|
|
|
|
|
|
// const child = spawn( |
|
|
|
// 'C:\\Program Files\\Git\\bin\\sh.exe' |
|
|
@@ -22,9 +36,9 @@ const child = spawn( |
|
|
|
// , ['../index.js', 'pull'], { env : ENV, cwd: __dirname }); |
|
|
|
|
|
|
|
|
|
|
|
process.stdin.pipe(child.stdin) |
|
|
|
child.stdout.pipe(process.stdout) |
|
|
|
child.stderr.pipe(process.stderr) |
|
|
|
// process.stdin.pipe(child.stdin) |
|
|
|
// child.stdout.pipe(process.stdout) |
|
|
|
// child.stderr.pipe(process.stderr) |
|
|
|
|
|
|
|
|
|
|
|
|