From 408bed7d7476cf0775eac3de45da4df328a4d2dd Mon Sep 17 00:00:00 2001 From: Salman Aljammaz Date: Thu, 17 Oct 2013 12:50:03 +0100 Subject: [PATCH] use XDG_CACHE_HOME for cache if set Change-Id: Id06be1e98c7b550cbb92cedd21fd852c0e158857 --- pkg/osutil/paths.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/osutil/paths.go b/pkg/osutil/paths.go index 53eff5a6b..41f66cb7a 100644 --- a/pkg/osutil/paths.go +++ b/pkg/osutil/paths.go @@ -70,6 +70,9 @@ func cacheDir() string { } panic("No Windows TEMP or TMP environment variables found; please file a bug report.") } + if xdg := os.Getenv("XDG_CACHE_HOME"); xdg != "" { + return filepath.Join(xdg, "camlistore") + } return filepath.Join(HomeDir(), ".cache", "camlistore") }