Fix MeshCentral version comparisons. (Breaking for versions -a through -c)

Ryan Blenis committed Nov 27, 2019 at 13:18 UTC 7be2e3d9ac8360c3d882b71182f758e987393924
1 file changed +2 -2
pluginHandler.js
+2 -2
@@ -285,8 +285,8 @@ module.exports.pluginHandler = function (parent) {
285 var s = require('semver');
286 // MeshCentral doesn't adhere to semantic versioning (due to the -<alpha_char> at the end of the version)
287 // Convert the letter to ASCII for a "true" version number comparison
288 - var mcCurVer = parent.currentVer.replace(/-(.)$/, (m, p1) => { return p1.charCodeAt(0); });
289 - var piCompatVer = newconf.meshCentralCompat.replace(/-(.)\b/g, (m, p1) => { return p1.charCodeAt(0); });
288 + var mcCurVer = parent.currentVer.replace(/-(.)$/, (m, p1) => { return ("000" + p1.charCodeAt(0)).substr(-3,3); });
289 + var piCompatVer = newconf.meshCentralCompat.replace(/-(.)\b/g, (m, p1) => { return ("000" + p1.charCodeAt(0)).substr(-3,3); });
290 latestRet.push({
291 'id': curconf._id,
292 'installedVersion': curconf.version,