fix: 修复pkgName == "."时windows下获取包名异常

This commit is contained in:
me262
2021-05-31 17:29:30 +08:00
parent 78defd91d9
commit ae72f8d9a3

View File

@@ -98,7 +98,9 @@ func (m *cnfModel) GetPkgName() string {
}
if len(pkgName) == 0 || pkgName == "." {
list = strings.Split(tools.GetModelPath(), "/")
curDir := tools.GetModelPath()
curDir = strings.Replace(curDir, "\\", "/", -1)
list = strings.Split(curDir, "/")
if len(list) > 0 {
pkgName = list[len(list)-1]
}