Merge pull request #4778 from w33ble/silent-shrinkwrap

Use exec.silent so npm errors are not swallowed
This commit is contained in:
Spencer 2015-08-27 09:47:02 -07:00
commit 5b0e3bdbbc

View file

@ -2,7 +2,7 @@ module.exports = function (grunt) {
let { config } = grunt;
let { statSync } = require('fs');
let { join } = require('path');
let exec = (...args) => require('../utils/exec')(...args, { cwd: config.get('root') });
let exec = (...args) => require('../utils/exec').silent(...args, { cwd: config.get('root') });
let newFiles = [];
let shrinkwrapFile = join(config.get('root'), 'npm-shrinkwrap.json');
@ -13,7 +13,7 @@ module.exports = function (grunt) {
if (e.code !== 'ENOENT') throw e;
if (createIfMissing) {
exec('npm', ['shrinkwrap', '--silent', '--dev']);
exec('npm', ['shrinkwrap', '--dev']);
newFiles.push(shrinkwrapFile);
}
else grunt.fail.warn('Releases require an npm-shrinkwrap.json file to exist');
@ -28,7 +28,7 @@ module.exports = function (grunt) {
exec('cp', ['npm-shrinkwrap.json', join(config.get('root'), 'build', 'kibana', 'npm-shrinkwrap.build.json')]);
// create shrinkwrap without dev dependencies and copy to build
exec('npm', ['shrinkwrap', '--silent']);
exec('npm', ['shrinkwrap']);
exec('cp', ['npm-shrinkwrap.json', join(config.get('root'), 'build', 'kibana', 'npm-shrinkwrap.json')]);
// restore the dev shrinkwrap