Skip to content

Commit c0c3a48

Browse files
committed
Cleanup previous PR
1 parent b84849a commit c0c3a48

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

kittens/desktop_ui/portal.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -321,24 +321,13 @@ var DataDirs = sync.OnceValue(func() (ans []string) {
321321

322322
data_dirs := os.Getenv("XDG_DATA_DIRS")
323323
if data_dirs == "" {
324-
data_dirs = "/usr/local/share/:/usr/share/"
324+
data_dirs = "/usr/local/share:/usr/share"
325325
}
326-
327326
data_home := os.Getenv("XDG_DATA_HOME")
328327
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")
340329
}
341-
return
330+
return utils.Uniq(append([]string{data_home}, strings.Split(data_dirs, ":")...))
342331
})
343332

344333
func IsDir(x string) bool {

0 commit comments

Comments
 (0)