use XDG_CACHE_HOME for cache if set

Change-Id: Id06be1e98c7b550cbb92cedd21fd852c0e158857
This commit is contained in:
Salman Aljammaz 2013-10-17 12:50:03 +01:00
parent a58dcc1e5a
commit 408bed7d74
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ func cacheDir() string {
} }
panic("No Windows TEMP or TMP environment variables found; please file a bug report.") 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") return filepath.Join(HomeDir(), ".cache", "camlistore")
} }