🎨 跳过常规库目录扫描

This commit is contained in:
Liang Ding 2018-10-05 20:52:11 +08:00
parent 87c528eac3
commit fb9a273af1
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import (
"path/filepath" "path/filepath"
"sort" "sort"
"strconv" "strconv"
"strings"
"sync" "sync"
"time" "time"
@ -532,7 +533,7 @@ func (sessions *wSessions) new(httpSession *sessions.Session, sid string) *WideS
workspaces := filepath.SplitList(conf.GetUserWorkspace(username)) workspaces := filepath.SplitList(conf.GetUserWorkspace(username))
for _, workspace := range workspaces { for _, workspace := range workspaces {
filepath.Walk(filepath.Join(workspace, "src"), func(dirPath string, f os.FileInfo, err error) error { filepath.Walk(filepath.Join(workspace, "src"), func(dirPath string, f os.FileInfo, err error) error {
if ".git" == f.Name() { // XXX: discard other unconcered dirs if strings.HasPrefix(f.Name(), ".") || "node_modules" == f.Name() || "vendor" == f.Name() {
return filepath.SkipDir return filepath.SkipDir
} }