[Skip CI]

This commit is contained in:
MetaCubeX
2022-03-15 01:30:17 +08:00
parent 3ab784dd80
commit cf52fbed65
5 changed files with 102 additions and 0 deletions

View File

@ -60,6 +60,21 @@ func (p *path) Resolve(path string) string {
}
func (p *path) MMDB() string {
files, err := ioutil.ReadDir(p.homeDir)
if err != nil {
return ""
}
for _, fi := range files {
if fi.IsDir() {
// 目录则直接跳过
continue
} else {
if strings.EqualFold(fi.Name(), "Country.mmdb") {
GeoipName = fi.Name()
return P.Join(p.homeDir, fi.Name())
}
}
}
return P.Join(p.homeDir, "Country.mmdb")
}