mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
Merge pull request #479 from scf2k/vendor-scan
Fix docs generator to ignore all child folders of the vendor folder
This commit is contained in:
commit
2265bfb0ff
@ -105,11 +105,12 @@ func ParsePackagesFromDir(dirpath string) {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7 is length of 'vendor' (6) + length of file path separator (1)
|
// skip folder if it's a 'vendor' folder within dirpath or its child,
|
||||||
// so we skip dir 'vendor' which is directly under dirpath
|
// all 'tests' folders and dot folders wihin dirpath
|
||||||
if !(len(fpath) == len(dirpath)+7 && strings.HasSuffix(fpath, "vendor")) &&
|
d, _ := filepath.Rel(dirpath, fpath)
|
||||||
|
if !(d == "vendor" || strings.HasPrefix(d, "vendor"+string(os.PathSeparator))) &&
|
||||||
!strings.Contains(fpath, "tests") &&
|
!strings.Contains(fpath, "tests") &&
|
||||||
!(len(fpath) > len(dirpath) && fpath[len(dirpath)+1] == '.') {
|
!(d[0] == '.') {
|
||||||
err = parsePackageFromDir(fpath)
|
err = parsePackageFromDir(fpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Send the error to through the channel and continue walking
|
// Send the error to through the channel and continue walking
|
||||||
|
Loading…
Reference in New Issue
Block a user