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
1 changed files with 8 additions and 2 deletions

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;
};