From 7be2e3d9ac8360c3d882b71182f758e987393924 Mon Sep 17 00:00:00 2001 From: Ryan Blenis Date: Wed, 27 Nov 2019 13:18:18 -0500 Subject: [PATCH] Fix MeshCentral version comparisons. (Breaking for versions -a through -c) --- pluginHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index 4b50010f..3d1e7e08 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -285,8 +285,8 @@ module.exports.pluginHandler = function (parent) { var s = require('semver'); // MeshCentral doesn't adhere to semantic versioning (due to the - at the end of the version) // Convert the letter to ASCII for a "true" version number comparison - var mcCurVer = parent.currentVer.replace(/-(.)$/, (m, p1) => { return p1.charCodeAt(0); }); - var piCompatVer = newconf.meshCentralCompat.replace(/-(.)\b/g, (m, p1) => { return p1.charCodeAt(0); }); + var mcCurVer = parent.currentVer.replace(/-(.)$/, (m, p1) => { return ("000" + p1.charCodeAt(0)).substr(-3,3); }); + var piCompatVer = newconf.meshCentralCompat.replace(/-(.)\b/g, (m, p1) => { return ("000" + p1.charCodeAt(0)).substr(-3,3); }); latestRet.push({ 'id': curconf._id, 'installedVersion': curconf.version,