Fix plugin version compare for new semver numbers

Ryan Blenis committed Apr 20, 2020 at 12:24 UTC 3a90988d810c3f73e25c18fe97633fd8bd1aa007
1 file changed +2 -3
pluginHandler.js
+2 -3
@@ -274,9 +274,8 @@ module.exports.pluginHandler = function (parent) {
274 })
275 };
276
277 - // MeshCentral doesn't adhere to semantic versioning (due to the -<alpha_char> at the end of the version)
278 - // Convert 1.2.3-a to 1.2.3-3 where the letter is converted to a number.
279 - obj.versionToNumber = function(ver) { var x = ver.split('-'); if (x.length != 2) return ver; x[1] = x[1].toLowerCase().charCodeAt(0) - 96; return x.join('.'); }
277 + // MeshCentral now adheres to semver, drop the -<alpha> off the version number for later versions for comparing plugins prior to this change
278 + obj.versionToNumber = function(ver) { var x = ver.split('-'); if (x.length != 2) return ver; return x[0]; }
279
280 // Check if the current version of MeshCentral is at least the minimal required.
281 obj.versionCompare = function(current, minimal) {