patch(geodata): fix incorrect geodata search path /etc/dae/dae caused by #84. (#90)

This commit is contained in:
mzz 2023-05-15 22:49:13 +08:00 committed by GitHub
parent 5ae3d90cfb
commit f15aa9e9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,11 +91,11 @@ func (c *LocationFinder) GetLocationAsset(log *logrus.Logger, filename string) (
searchDirs = append(searchDirs, c.externDirs...)
if runtime.GOOS != "windows" {
// Search XDG data directories on non windows platform
searchDirs = append(searchDirs, xdg.DataHome)
searchDirs = append(searchDirs, xdg.DataDirs...)
for i := range searchDirs {
searchDirs[i] = filepath.Join(searchDirs[i], folder)
xdgDirs := append([]string{xdg.DataHome}, xdg.DataDirs...)
for i := range xdgDirs {
xdgDirs[i] = filepath.Join(xdgDirs[i], folder)
}
searchDirs = append(searchDirs, xdgDirs...)
} else {
// fallback to the old behavior of using only current dir on Windows
pwd := "./"