mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-03 02:49:47 +00:00
fix(main): Resolve relative data directory paths to executable location
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user