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:
parent
a69683183f
commit
ddb2ea4b5f
@ -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
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user