🙉 Ignore stdout from installation of apm

This commit is contained in:
Kevin Sawicki
2013-11-15 09:53:59 -08:00
parent 941fc97e79
commit caffcafe2e
2 changed files with 14 additions and 7 deletions

View File

@@ -5,9 +5,15 @@ var path = require('path');
// Executes an array of commands one by one.
function executeCommands(commands, done, index) {
index = (index == undefined ? 0 : index);
if (index < commands.length)
safeExec(commands[index], executeCommands.bind(this, commands, done, index + 1));
else
if (index < commands.length) {
var command = commands[index];
var options = null;
if (typeof command !== 'string') {
options = command.options;
command = command.command;
}
safeExec(command, options, executeCommands.bind(this, commands, done, index + 1));
} else
done(null);
}
@@ -21,8 +27,8 @@ var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
joinCommands('cd vendor/apm', 'npm install --silent .'),
'npm install --silent vendor/apm',
{command: joinCommands('cd vendor/apm', 'npm install --silent .'), options: {ignoreStdout: true}},
{command: 'npm install --silent vendor/apm', options: {ignoreStdout: true}},
echoNewLine,
'node node_modules/atom-package-manager/bin/apm clean',
'node node_modules/atom-package-manager/bin/apm install --silent',

View File

@@ -10,7 +10,7 @@ exports.safeExec = function(command, options, callback) {
if (!options)
options = {};
// This needed to be increase for `apm test` runs that generate tons of failures
// This needed to be increased for `apm test` runs that generate many failures
// The default is 200KB.
options.maxBuffer = 1024 * 1024;
@@ -21,7 +21,8 @@ exports.safeExec = function(command, options, callback) {
callback(null);
});
child.stderr.pipe(process.stderr);
child.stdout.pipe(process.stdout);
if (!options.ignoreStdout)
child.stdout.pipe(process.stdout);
}
// Same with safeExec but call child_process.spawn instead.