File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -321,24 +321,13 @@ var DataDirs = sync.OnceValue(func() (ans []string) {
321
321
322
322
data_dirs := os .Getenv ("XDG_DATA_DIRS" )
323
323
if data_dirs == "" {
324
- data_dirs = "/usr/local/share/ :/usr/share/ "
324
+ data_dirs = "/usr/local/share:/usr/share"
325
325
}
326
-
327
326
data_home := os .Getenv ("XDG_DATA_HOME" )
328
327
if data_home == "" {
329
- data_home = os .Getenv ("HOME" ) + "/.local/share"
330
- }
331
-
332
- all := []string {data_home }
333
- all = append (all , strings .Split (data_dirs , ":" )... )
334
- seen := map [string ]bool {}
335
- for _ , x := range all {
336
- if ! seen [x ] {
337
- seen [x ] = true
338
- ans = append (ans , x )
339
- }
328
+ data_home = utils .Expanduser ("~/.local/share" )
340
329
}
341
- return
330
+ return utils . Uniq ( append ([] string { data_home }, strings . Split ( data_dirs , ":" ) ... ))
342
331
})
343
332
344
333
func IsDir (x string ) bool {
You can’t perform that action at this time.
0 commit comments