mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 18:12:26 +01:00
Fix plugin loading
This commit is contained in:
@@ -908,8 +908,11 @@ const liberator = (function () //{{{
|
||||
{
|
||||
let dirs = io.getRuntimeDirectories("plugin");
|
||||
|
||||
if (dirs.length > 0)
|
||||
if (dirs.length == 0)
|
||||
{
|
||||
liberator.log("No user plugin directory found", 3);
|
||||
return;
|
||||
}
|
||||
for (let [,dir] in Iterator(dirs))
|
||||
{
|
||||
// TODO: search plugins/**/* for plugins
|
||||
@@ -920,23 +923,18 @@ const liberator = (function () //{{{
|
||||
let files = io.readDirectory(dir.path, true);
|
||||
|
||||
files.forEach(function (file) {
|
||||
if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path) && !(file.path in pluginFiles))
|
||||
if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path) && !(file.path in liberator.pluginFiles))
|
||||
{
|
||||
try
|
||||
{
|
||||
io.source(file.path, false);
|
||||
pluginFiles[file.path] = true;
|
||||
liberator.pluginFiles[file.path] = true;
|
||||
}
|
||||
catch (e) {};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
liberator.log("No user plugin directory found", 3);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// thrown if directory does not exist
|
||||
|
||||
Reference in New Issue
Block a user