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

Version check no meta (#1243)

* Version check on module loading - remove all metadata information bevor comparing the versions.

* refined regex
This commit is contained in:
mw75 2017-05-15 14:57:35 +02:00 committed by Nick O'Leary
parent 48958f392f
commit 0ee7ffb5e5

View File

@ -116,7 +116,7 @@ function loadNodeFiles(nodeFiles) {
/* istanbul ignore else */ /* istanbul ignore else */
if (nodeFiles.hasOwnProperty(module)) { if (nodeFiles.hasOwnProperty(module)) {
if (nodeFiles[module].redVersion && if (nodeFiles[module].redVersion &&
!semver.satisfies(runtime.version().replace("-git",""), nodeFiles[module].redVersion)) { !semver.satisfies(runtime.version().replace(/(\-[1-9A-Za-z-][0-9A-Za-z-\.]*)?(\+[0-9A-Za-z-\.]+)?$/,""), nodeFiles[module].redVersion)) {
//TODO: log it //TODO: log it
runtime.log.warn("["+module+"] "+runtime.log._("server.node-version-mismatch",{version:nodeFiles[module].redVersion})); runtime.log.warn("["+module+"] "+runtime.log._("server.node-version-mismatch",{version:nodeFiles[module].redVersion}));
continue; continue;