mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-03 00:52:59 +00:00
Fix problems with $tw.utils.checkVersions()
Previous changes since 5.1.7 broke the documented semantics by no longer returning true when the versions match. It affected the upgrade process, making it impossible to upgrade to a later pre-release (ie where the version numbers in the upgrade.html match those in the file being upgraded). Also reviewed and updated the calls to checkVersions. @felixhayashi I think that this effectively reverts the change you original submitted. Are you OK with it?
This commit is contained in:
@@ -375,7 +375,7 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) {
|
||||
];
|
||||
return (diff[0] > 0) ||
|
||||
(diff[0] === 0 && diff[1] > 0) ||
|
||||
(diff[0] === 0 && diff[1] === 0 && diff[2] > 0);
|
||||
(diff[0] === 0 && diff[1] === 0 && diff[2] >= 0);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1750,7 +1750,7 @@ $tw.boot.startup = function(options) {
|
||||
// Read package info
|
||||
$tw.packageInfo = require("../package.json");
|
||||
// Check node version number
|
||||
if($tw.utils.checkVersions($tw.packageInfo.engines.node.substr(2),process.version.substr(1))) {
|
||||
if(!$tw.utils.checkVersions(process.version.substr(1),$tw.packageInfo.engines.node.substr(2))) {
|
||||
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user