diff options
Diffstat (limited to 'plugin_loader.js')
-rw-r--r-- | plugin_loader.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugin_loader.js b/plugin_loader.js index 8b62c44..675bcd3 100644 --- a/plugin_loader.js +++ b/plugin_loader.js @@ -70,6 +70,28 @@ let PLUGIN_INFO = : obj.toString().split(/[,| \t\r\n]+/); } + function around () { + liberator.plugins.libly.$U.around( + io, + 'getRuntimeDirectories', + function (next, [path]) { + let dirs = next(); + // XXX Win 以外でも \\ を考慮しちゃうつ + let [m, dirname] = path.match(/^plugin[\/\\]?(.*)$/) || []; + if (m) { + roots.forEach(function (root) { + let rf = io.File(root); + if (dirname) + rf.append(dirname); + if (rf.exists() && rf.isDirectory()) + dirs.push(rf); + }); + } + return dirs; + } + ); + } + let roots = toArray(liberator.globalVariables.plugin_loader_roots).map(io.expandPath); let plugins = toArray(liberator.globalVariables.plugin_loader_plugins); let filter = new RegExp('[\\\\/](?:' + @@ -79,6 +101,8 @@ let PLUGIN_INFO = liberator.log('plugin_loader: loading'); + let arounded = false; + roots.forEach(function (root) { let dir = io.File(root); if (dir.exists() && dir.isDirectory() && dir.isReadable()) { @@ -94,6 +118,10 @@ let PLUGIN_INFO = } else { liberator.echoerr('plugin_loader.js: context not found (' + file.path + ')'); } + if (!arounded && file.leafName === '_libly.js') { + arounded = true; + around(); + } } }); } else { |