verify if 3rd module has not failed

This commit is contained in:
Alexandre Strzelewicz 2017-09-21 16:44:50 +02:00
parent 5aa7dcec07
commit 2103ad38c0

View File

@ -235,8 +235,10 @@ function installLangModule(module_name, cb) {
cwd : node_module_path
});
install_instance.on('close', function done() {
cb(null);
install_instance.on('close', function(code) {
if (code > 0)
return cb(new Error('Module install failed'));
return cb(null);
});
install_instance.on('error', function (err) {
@ -337,8 +339,13 @@ Modularizer.install = function(CLI, module_name, opts, cb) {
var canonic_module_name = Utility.getCanonicModuleName(module_name);
if (module_name == 'v8-profiler' || module_name == 'profiler') {
installLangModule('v8-profiler', function(e) {
Common.printOut(cst.PREFIX_MSG + chalk.bold.green('V8 profiling enabled'));
installLangModule('v8-pasdrofiler', function(err) {
if (err) {
Common.printError(cst.PREFIX_MSG_MOD_ERR + chalk.bold.green('Profling installation has FAILED (checkout previous logs)'));
return cb(err);
}
Common.printOut(cst.PREFIX_MSG + chalk.bold.green('V8 profiling ENABLED'));
return cb();
});
return false;