Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function pipeSpawn(cmd, params, opts) {
const cp = spawn(
cmd,
params,
Object.assign(
{
env: Object.assign(
{
FORCE_COLOR: logger.color,
npm_config_color: logger.color ? 'always' : '',
npm_config_progress: true
},
process.env
)
},
opts
)
);
cp.stdout.setEncoding('utf8').on('data', d => logger.writeRaw(d));
cp.stderr.setEncoding('utf8').on('data', d => logger.writeRaw(d));
return new Promise((resolve, reject) => {
cp.on('error', reject);
cp.on('close', function(code) {
function pipeSpawn(cmd, params, opts) {
const cp = spawn(
cmd,
params,
Object.assign(
{
env: Object.assign(
{
FORCE_COLOR: logger.color,
npm_config_color: logger.color ? 'always' : '',
npm_config_progress: true
},
process.env
)
},
opts
)
);
cp.stdout.setEncoding('utf8').on('data', d => logger.writeRaw(d));
cp.stderr.setEncoding('utf8').on('data', d => logger.writeRaw(d));
return new Promise((resolve, reject) => {
cp.on('error', reject);
cp.on('close', function(code) {
if (code !== 0) {