1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

A slightly more concise way of reading package.json

This commit is contained in:
Jeremy Ruston 2013-06-26 23:51:57 +01:00
parent 7999b86d5d
commit 90d7d0b3a5

View File

@ -1255,7 +1255,7 @@ $tw.boot.startup = function() {
} }
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir); $tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
// Read package info // Read package info
$tw.packageInfo = JSON.parse(fs.readFileSync($tw.boot.corePath + "/../package.json")); $tw.packageInfo = require("../package");
// Check node version number // Check node version number
if($tw.utils.checkVersions($tw.packageInfo.engines.node.substr(2),process.version.substr(1))) { if($tw.utils.checkVersions($tw.packageInfo.engines.node.substr(2),process.version.substr(1))) {
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engine.node); $tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engine.node);