1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 22:22:27 +01:00

Fix plugin loading

This commit is contained in:
Kris Maglione
2008-10-16 00:19:03 +00:00
parent 00039bf6c5
commit bb32ae917c

View File

@@ -908,8 +908,11 @@ const liberator = (function () //{{{
{ {
let dirs = io.getRuntimeDirectories("plugin"); 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)) for (let [,dir] in Iterator(dirs))
{ {
// TODO: search plugins/**/* for plugins // TODO: search plugins/**/* for plugins
@@ -920,23 +923,18 @@ const liberator = (function () //{{{
let files = io.readDirectory(dir.path, true); let files = io.readDirectory(dir.path, true);
files.forEach(function (file) { 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 try
{ {
io.source(file.path, false); io.source(file.path, false);
pluginFiles[file.path] = true; liberator.pluginFiles[file.path] = true;
} }
catch (e) {}; catch (e) {};
} }
}); });
} }
} }
else
{
liberator.log("No user plugin directory found", 3);
}
}
catch (e) catch (e)
{ {
// thrown if directory does not exist // thrown if directory does not exist