diff options
author | secondlife | 2009-03-02 02:15:13 +0000 |
---|---|---|
committer | secondlife | 2009-03-02 02:15:13 +0000 |
commit | 823ed6313e876c044f47e72e63d3aa3cea421366 (patch) | |
tree | d04546dfe8c6ffd578f3b1bf4864ca2a98b36ea4 | |
parent | 7b32d4559d7ebdc150fbb9e6c1907c6da132de95 (diff) | |
download | vimperator-plugins-823ed6313e876c044f47e72e63d3aa3cea421366.tar.bz2 |
root ディレクトリが無い場合の処理を追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@30684 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | plugin_loader.js | 19 |
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'); |