允许library目录下三层深度存在由点开头的额外文件夹

This commit is contained in:
TevinLi 2016-08-20 21:53:02 +08:00
parent 9386ed3d42
commit 5ca6892c02
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# amWiki 文库
amWiki是一套非常简单基于atom编辑器markdown语法的轻量级wiki文库系统。
amWiki是一基于atom编辑器markdown语法的轻量级wiki文库系统。
使用amWiki创建文库仅需要您使用atom编辑markdown文档和支持http静态访问网页空间
[amWiki项目托管](https://github.com/TevinLi/amWiki "amWiki项目托管地址")

View File

@ -22,7 +22,7 @@ module.exports = {
//第一层files1library直接子级仅允许为文件夹
for (var i = 0; i < files1.length; i++) {
path2 = path + files1[i];
if (/^\./.test(path2.split('library/')[1])) {
if (/^\./.test(files1[i])) {
continue;
}
if (fs.statSync(path2).isDirectory(path2)) {
@ -33,6 +33,9 @@ module.exports = {
//第二层files2允许为文件夹和文件
for (var j = 0; j < files2.length; j++) {
path3 = path2 + '/' + files2[j];
if (/^\./.test(files2[j])) {
continue;
}
if (fs.statSync(path3).isDirectory(path3)) {
try {
files3 = fs.readdirSync(path3);
@ -41,6 +44,9 @@ module.exports = {
//第三层files3仅允许为文件夹不再深入
for (var k = 0; k < files3.length; k++) {
path4 = path3 + '/' + files3[k];
if (/^\./.test(files3[k])) {
continue;
}
if (!fs.statSync(path4).isDirectory(path4)) {
tree[files1[i]][files2[j]][files3[k]] = false;
files.push(path4);