From 898e86db7974b9d7beafbff1fa2e4f858483a15c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 13 Jul 2012 17:38:23 +0100 Subject: [PATCH] Use the version number from the package.json file Instead of the old separate version.txt file --- core/modules/commands/version.js | 2 +- core/modules/macros/version.js | 2 +- core/modules/utils.js | 36 ++------------------ core/templates/tiddlywiki5.template.html.tid | 2 +- core/version.txt | 1 - package.json | 2 +- 6 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 core/version.txt diff --git a/core/modules/commands/version.js b/core/modules/commands/version.js index 7be0d6a6f..24edc97f7 100644 --- a/core/modules/commands/version.js +++ b/core/modules/commands/version.js @@ -23,7 +23,7 @@ var Command = function(params,commander) { }; Command.prototype.execute = function() { - this.commander.streams.output.write($tw.utils.getVersionString() + "\n"); + this.commander.streams.output.write($tw.version + "\n"); return null; // No error }; diff --git a/core/modules/macros/version.js b/core/modules/macros/version.js index 22fb98370..43d410c3b 100644 --- a/core/modules/macros/version.js +++ b/core/modules/macros/version.js @@ -19,7 +19,7 @@ exports.info = { }; exports.executeMacro = function() { - return $tw.Tree.Text($tw.utils.getVersionString()); + return $tw.Tree.Text($tw.version); }; })(); diff --git a/core/modules/utils.js b/core/modules/utils.js index f740bbf79..91313a287 100644 --- a/core/modules/utils.js +++ b/core/modules/utils.js @@ -249,36 +249,6 @@ exports.unHyphenateCss = function(propName) { } }; -/* -Parse a version number string of the form "1.2.3", "1.2.3.a4", or "1.2.3.b4" into: - {major: , minor: , revision: , alpha: , beta: } -*/ -exports.parseVersion = function(versionString) { - versionString = versionString || "0.0.0"; - var components = versionString.split("."), - version = { - major: components[0] ? parseInt(components[0],10) : null, - minor: components[1] ? parseInt(components[1],10) : null, - revision: components[2] ? parseInt(components[2],10) : null - }; - if(components[3]) { - if(components[3].charAt(0) === "a") { - version.alpha = parseInt(components[3].substr(1),10); - } else if(components[3].charAt(0) === "b") { - version.beta = parseInt(components[3].substr(1),10); - } - } - return version; -}; - -exports.getVersionString = function() { - return ($tw.version.major || "0") + "." + - ($tw.version.minor || "0") + "." + - ($tw.version.revision || "0") + - ($tw.version.alpha ? ".a" + $tw.version.alpha : "") + - ($tw.version.beta ? ".b" + $tw.version.beta : ""); -}; - /* Extract the version number from the meta tag or from the boot file */ @@ -291,10 +261,10 @@ exports.extractVersionInfo = function() { for(var t=0; t ->" /> + diff --git a/core/version.txt b/core/version.txt deleted file mode 100644 index 6f86127cd..000000000 --- a/core/version.txt +++ /dev/null @@ -1 +0,0 @@ -5.0.0.a3 \ No newline at end of file diff --git a/package.json b/package.json index ff52255a9..f876b2b00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tiddlywiki", "preferGlobal": "true", - "version": "0.0.1", + "version": "5.0.0-alpha.4", "author": "Jeremy Ruston ", "description": "a reusable non-linear personal web notebook", "contributors": [