[build test] 1.18

This commit is contained in:
MetaCubeX 2022-03-16 21:47:00 +08:00
parent 016862f7a5
commit 2f24e49ff6
2 changed files with 11 additions and 1 deletions

View file

@ -146,6 +146,16 @@ func Init(dir string) error {
f.Write([]byte(`mixed-port: 7890`)) f.Write([]byte(`mixed-port: 7890`))
f.Close() f.Close()
} }
buf, _ := os.ReadFile(C.Path.Config())
rawCfg, err := UnmarshalRawConfig(buf)
if err != nil {
log.Errorln(err.Error())
fmt.Printf("configuration file %s test failed\n", C.Path.Config())
os.Exit(1)
}
if !C.GeodataMode {
C.GeodataMode = rawCfg.GeodataMode
}
// initial GeoIP // initial GeoIP
if err := initGeoIP(); err != nil { if err := initGeoIP(); err != nil {
return fmt.Errorf("can't initial GeoIP: %w", err) return fmt.Errorf("can't initial GeoIP: %w", err)

View file

@ -73,7 +73,7 @@ func main() {
C.SetConfig(configFile) C.SetConfig(configFile)
} }
if geodataMode || executor.GetGeneral().GeodataMode { if geodataMode {
C.GeodataMode = true C.GeodataMode = true
} }