From 18d23048daae971f62bd0c3f53224172f977790b Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 23 May 2024 16:47:28 +0100 Subject: [PATCH] Improve plugin test implementation --- boot/boot.js | 15 +++++++++------ core/modules/utils/repository.js | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index d993499b6..dae5cb28e 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2188,13 +2188,16 @@ Returns an array of search paths */ $tw.getLibraryItemSearchPaths = function(libraryPath,envVar) { var pluginPaths = [path.resolve($tw.boot.corePath,libraryPath)], + env; + if(envVar) { env = process.env[envVar]; - if(env) { - env.split(path.delimiter).map(function(item) { - if(item) { - pluginPaths.push(item); - } - }); + if(env) { + env.split(path.delimiter).map(function(item) { + if(item) { + pluginPaths.push(item); + } + }); + } } return pluginPaths; }; diff --git a/core/modules/utils/repository.js b/core/modules/utils/repository.js index be10d7928..3aeb4d25a 100644 --- a/core/modules/utils/repository.js +++ b/core/modules/utils/repository.js @@ -43,9 +43,9 @@ exports.getAllPlugins = function(options) { } } }; - $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,options.ignoreEnvironmentVariables ? "" : $tw.config.pluginsEnvVar),collectPublisherPlugins); - $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,options.ignoreEnvironmentVariables ? "" : $tw.config.themesEnvVar),collectPublisherPlugins); - $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,options.ignoreEnvironmentVariables ? "" : $tw.config.languagesEnvVar),collectPlugins); + $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.pluginsEnvVar),collectPublisherPlugins); + $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.themesEnvVar),collectPublisherPlugins); + $tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.languagesEnvVar),collectPlugins); return tiddlers; };