mirror of
https://github.com/beego/bee.git
synced 2025-02-22 04:17:16 +00:00
Merge 866fea3504e94ecbac76169d655de0ba7bfcdce9 into 932f16ba4e0d685df00ab03efa8288673db34014
This commit is contained in:
commit
d7b329de99
12
g_appcode.go
12
g_appcode.go
@ -962,13 +962,21 @@ func getPackagePath(curpath string) (packpath string) {
|
||||
wgopath := filepath.SplitList(gopath)
|
||||
|
||||
for _, wg := range wgopath {
|
||||
wg, _ = filepath.EvalSymlinks(path.Join(wg, "src"))
|
||||
|
||||
//Maybe is a path
|
||||
if filepath.HasPrefix(strings.ToLower(curpath), strings.ToLower(wg)) {
|
||||
haspath = true
|
||||
appsrcpath = wg
|
||||
break
|
||||
}
|
||||
|
||||
//Maybe is a symlink
|
||||
wg, _ = filepath.EvalSymlinks(path.Join(wg, "src"))
|
||||
cur,_ := filepath.EvalSymlinks(curpath)
|
||||
if filepath.HasPrefix(strings.ToLower(cur), strings.ToLower(wg)) {
|
||||
haspath = true
|
||||
appsrcpath = wg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !haspath {
|
||||
|
Loading…
x
Reference in New Issue
Block a user