1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

autoInstallModules option must honour version/pending_version

This commit is contained in:
Nick O'Leary 2017-01-25 11:07:02 +00:00
parent a69683183f
commit ddb2ea4b5f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -126,14 +126,19 @@ function start() {
var missingModules = {}; var missingModules = {};
for (i=0;i<nodeMissing.length;i++) { for (i=0;i<nodeMissing.length;i++) {
var missing = nodeMissing[i]; var missing = nodeMissing[i];
missingModules[missing.module] = (missingModules[missing.module]||[]).concat(missing.types); missingModules[missing.module] = missingModules[missing.module]||{
module:missing.module,
version:missing.pending_version||missing.version,
types:[]
}
missingModules[missing.module].types = missingModules[missing.module].types.concat(missing.types);
} }
var promises = []; var promises = [];
for (i in missingModules) { for (i in missingModules) {
if (missingModules.hasOwnProperty(i)) { if (missingModules.hasOwnProperty(i)) {
log.warn(" - "+i+": "+missingModules[i].join(", ")); log.warn(" - "+i+" ("+missingModules[i].version+"): "+missingModules[i].types.join(", "));
if (settings.autoInstallModules && i != "node-red") { if (settings.autoInstallModules && i != "node-red") {
redNodes.installModule(i).otherwise(function(err) { redNodes.installModule(i,missingModules[i].version).otherwise(function(err) {
// Error already reported. Need the otherwise handler // Error already reported. Need the otherwise handler
// to stop the error propagating any further // to stop the error propagating any further
}); });