kibana/tasks/npm_install_kibana.js

21 lines
636 B
JavaScript
Raw Normal View History

var child_process = require('child_process');
var join = require('path').join;
module.exports = function (grunt) {
2015-01-09 19:08:14 +01:00
grunt.registerTask('npm_install_kibana', 'NPM isntall kibana server into dist', function () {
var done = this.async();
2015-01-09 19:08:14 +01:00
var cwd = join(grunt.config.get('build'), 'dist', 'kibana', 'src');
var command = 'npm install --production --no-optional';
2015-01-09 19:08:14 +01:00
var options = { cwd: cwd };
child_process.exec(command, options, function (err, stdout, stderr) {
if (err) {
grunt.log.error(stderr);
return done(err);
}
grunt.log.writeln(stdout);
return done();
});
});
};
2015-01-09 19:08:14 +01:00