Skip to content

Commit

Permalink
Remove xdgPath and xdgPaths functions
Browse files Browse the repository at this point in the history
  • Loading branch information
adrg committed Jul 7, 2024
1 parent 28fbf4c commit e9e51ac
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions xdg.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package xdg

import (
"os"
"path/filepath"

"github.com/adrg/xdg/internal/pathutil"
)

Expand Down Expand Up @@ -198,21 +195,3 @@ func SearchCacheFile(relPath string) (string, error) {
func SearchRuntimeFile(relPath string) (string, error) {
return baseDirs.searchRuntimeFile(relPath)
}

func xdgPath(name string, defaultPaths ...string) string {
dir := pathutil.ExpandHome(os.Getenv(name))
if dir != "" && filepath.IsAbs(dir) {
return dir
}

return pathutil.First(defaultPaths)
}

func xdgPaths(name string, defaultPaths ...string) []string {
dirs := pathutil.Unique(filepath.SplitList(os.Getenv(name)))
if len(dirs) != 0 {
return dirs
}

return pathutil.Unique(defaultPaths)
}

0 comments on commit e9e51ac

Please sign in to comment.