From 378e00aee89d816ed661f18ad0ffebd4750b1c9d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 12 Sep 2017 15:53:52 +0100 Subject: [PATCH] Give a warning message for missing plugin.info files --- boot/boot.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 284d58db9..f3f716943 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1638,9 +1638,14 @@ Load the tiddlers from a plugin folder, and package them up into a proper JSON p */ $tw.loadPluginFolder = function(filepath,excludeRegExp) { excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp; + var infoPath = filepath + path.sep + "plugin.info"; if(fs.existsSync(filepath) && fs.statSync(filepath).isDirectory()) { // Read the plugin information - var pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8")); + if(!fs.existsSync(infoPath) || !fs.statSync(infoPath).isFile()) { + console.log("Warning: missing plugin.info file in " + filepath); + return null; + } + var pluginInfo = JSON.parse(fs.readFileSync(infoPath,"utf8")); // Read the plugin files var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp); // Save the plugin tiddlers into the plugin info