-
Notifications
You must be signed in to change notification settings - Fork 13
/
lazypath_unix.go
32 lines (26 loc) · 1015 Bytes
/
lazypath_unix.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//go:build !windows
package hlnpath
import (
"path/filepath"
"k8s.io/client-go/util/homedir"
)
// dataHome defines the base directory relative to which user specific data files should be stored.
//
// If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share is used.
func dataHome(cmd string) string {
return filepath.Join(homedir.HomeDir(), "."+cmd, "data")
}
// configHome defines the base directory relative to which user specific configuration files should
// be stored.
//
// If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config is used.
func configHome(cmd string) string {
return filepath.Join(homedir.HomeDir(), "."+cmd, "config")
}
// cacheHome defines the base directory relative to which user specific non-essential data files
// should be stored.
//
// If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache is used.
func cacheHome(cmd string) string {
return filepath.Join(homedir.HomeDir(), "."+cmd, "cache")
}