1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

fix problem if edition search path is TIDDLYWIKI_EDITION_PATH=c:\test; because the trailing semicolon creates an empty directory name.

This commit is contained in:
Mario Pietsch 2015-02-12 14:44:10 +01:00
parent ddac13317e
commit 17c38b1ec5

View File

@ -1544,9 +1544,15 @@ Returns an array of search paths
*/
$tw.getLibraryItemSearchPaths = function(libraryPath,envVar) {
var pluginPaths = [path.resolve($tw.boot.corePath,libraryPath)],
env = process.env[envVar];
env = process.env[envVar],
paths = [];
if(env) {
Array.prototype.push.apply(pluginPaths,env.split(path.delimiter));
env.split(path.delimiter).map(function(item){
if(item) {
paths.push(item)
}
});
Array.prototype.push.apply(pluginPaths,paths);
}
return pluginPaths;
};