MCPcopy Create free account
hub / github.com/containerd/nerdctl / XDGConfigHome

Function XDGConfigHome

pkg/rootlessutil/xdg_linux.go:42–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func XDGConfigHome() (string, error) {
43 if xch := os.Getenv("XDG_CONFIG_HOME"); xch != "" {
44 return xch, nil
45 }
46 // Fall back to "~/.config"
47 // Note that We cannot rely on user.Current().HomeDir because we might be inside UserNS.
48 home := os.Getenv("HOME")
49 if home == "" {
50 return "", errors.New("environment variable HOME is not set")
51 }
52 return filepath.Join(home, ".config"), nil
53}
54
55func XDGDataHome() (string, error) {
56 if xdh := os.Getenv("XDG_DATA_HOME"); xdh != "" {

Callers 4

CNINetConfPathFunction · 0.92
NerdctlTOMLFunction · 0.92
HostsDirsFunction · 0.92
CDISpecDirsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…