aboutsummaryrefslogtreecommitdiffstats
path: root/plugin_loader.js
diff options
context:
space:
mode:
authorsecondlife2009-03-02 02:15:13 +0000
committersecondlife2009-03-02 02:15:13 +0000
commit823ed6313e876c044f47e72e63d3aa3cea421366 (patch)
treed04546dfe8c6ffd578f3b1bf4864ca2a98b36ea4 /plugin_loader.js
parent7b32d4559d7ebdc150fbb9e6c1907c6da132de95 (diff)
downloadvimperator-plugins-823ed6313e876c044f47e72e63d3aa3cea421366.tar.bz2
root ディレクトリが無い場合の処理を追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@30684 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'plugin_loader.js')
-rw-r--r--plugin_loader.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/plugin_loader.js b/plugin_loader.js
index 166ff4d..2a2e1d6 100644
--- a/plugin_loader.js
+++ b/plugin_loader.js
@@ -80,13 +80,18 @@ let PLUGIN_INFO =
liberator.log('plugin_loader: loading');
roots.forEach(function (root) {
- let files = io.readDirectory(io.getFile(root), true);
- files.forEach(function (file) {
- if (filter.test(file.path)) {
- liberator.log("Sourcing: " + file.path);
- io.source(file.path, false);
- }
- });
+ let dir = io.getFile(root);
+ if (dir.exists() && dir.isDirectory() && dir.isReadable()) {
+ let files = io.readDirectory(dir, true);
+ files.forEach(function (file) {
+ if (filter.test(file.path)) {
+ liberator.log("Sourcing: " + file.path);
+ io.source(file.path, false);
+ }
+ });
+ } else {
+ liberator.log("Directory not found: " + dir.path);
+ }
});
liberator.log('plugin_loader: loaded');