排除 .git 目录

This commit is contained in:
Liang Ding 2014-08-31 14:07:35 +08:00
parent e766390880
commit 9664a7cada
3 changed files with 7 additions and 6 deletions

View File

@ -203,11 +203,16 @@ func listFiles(dirname string) []string {
dirs := []string{}
files := []string{}
// 目录靠前,文件靠后
// 排序:目录靠前,文件靠后
for _, name := range names {
fio, _ := os.Lstat(filepath.Join(dirname, name))
if fio.IsDir() {
// 排除 .git 目录
if ".git" == fio.Name() {
continue
}
dirs = append(dirs, name)
} else {
files = append(files, name)

View File

@ -75,9 +75,6 @@ var editors = {
cursorCh: editor.getCursor().ch
};
// XXX: 回调有问题,暂时不使用 WS 协议
//editorWS.send(JSON.stringify(request));
var autocompleteHints = [];
$.ajax({

View File

@ -126,8 +126,7 @@ var tree = {
}
};
tree.fileTree = $.fn.zTree.init($("#files"), setting, data.root.children);
// TODO: remove
tree.fileTree.expandAll(true);
// tree.fileTree.expandAll(true);
}
}
});