fix(main): Resolve relative data directory paths to executable location

This commit is contained in:
zarazaex69
2026-04-09 19:58:48 +03:00
parent 5c72dd185d
commit 661ed9f39a

View File

@@ -57,6 +57,14 @@ func main() {
log.Fatal("Specify -mode srv or -mode cnc")
}
if !filepath.IsAbs(dataDir) {
exePath, err := os.Executable()
if err == nil {
exeDir := filepath.Dir(exePath)
dataDir = filepath.Join(exeDir, dataDir)
}
}
namesPath := filepath.Join(dataDir, "names")
surnamesPath := filepath.Join(dataDir, "surnames")