From 75f11a0c8dc847746104a59ca37967cadfd2d599 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 5 May 2012 14:48:15 +0100 Subject: [PATCH] Load the non-shadow tiddlers into the correct wiki store --- rabbithole/core/boot.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/rabbithole/core/boot.js b/rabbithole/core/boot.js index 9bb5527ba..3b0023d96 100644 --- a/rabbithole/core/boot.js +++ b/rabbithole/core/boot.js @@ -528,7 +528,8 @@ $tw.boot.wikiPath = process.cwd(); /* Load the tiddlers contained in a particular file (and optionally the accompanying .meta file) */ -$tw.plugins.loadTiddlersFromFile = function(file,fields) { +$tw.plugins.loadTiddlersFromFile = function(file,fields,wiki) { + wiki = wiki || $tw.wiki; var ext = path.extname(file), extensionInfo = $tw.config.fileExtensions[ext], data = fs.readFileSync(file).toString(extensionInfo ? extensionInfo.encoding : "utf8"), @@ -540,15 +541,16 @@ $tw.plugins.loadTiddlersFromFile = function(file,fields) { tiddlers = [$tw.utils.parseFields(metadata,tiddlers[0])]; } } - $tw.wiki.shadows.addTiddlers(tiddlers); + wiki.addTiddlers(tiddlers); }; /* Load all the plugins from the plugins directory */ -$tw.plugins.loadPluginsFromFolder = function(filepath,basetitle,excludeRegExp) { +$tw.plugins.loadPluginsFromFolder = function(filepath,basetitle,excludeRegExp,wiki) { basetitle = basetitle || "$:/plugins"; excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/; + wiki = wiki || $tw.wiki.shadows; if(path.existsSync(filepath)) { var stat = fs.statSync(filepath); if(stat.isDirectory()) { @@ -558,19 +560,19 @@ $tw.plugins.loadPluginsFromFolder = function(filepath,basetitle,excludeRegExp) { // If so, process the files it describes var pluginInfo = JSON.parse(fs.readFileSync(filepath + "/tiddlywiki.plugin").toString("utf8")); for(var p=0; p