From c7d3f606b28664ef62ca365d978ccdde21d610d5 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 19 Mar 2012 13:07:46 -0700 Subject: [PATCH] osutil: add per-OS CamliBlobRoot; use .camlistore, not .camli Change-Id: I9e085d3f7a38357eca0bee0d5576a3db7cb1455e --- pkg/osutil/paths.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/osutil/paths.go b/pkg/osutil/paths.go index 29da17fd3..073e4b24a 100644 --- a/pkg/osutil/paths.go +++ b/pkg/osutil/paths.go @@ -37,14 +37,24 @@ func CacheDir() string { return filepath.Join(HomeDir(), ".cache") } +func CamliBlobRoot() string { + switch runtime.GOOS { + case "windows": + return filepath.Join(os.Getenv("APPDATA"), "Camlistore", "blobs") + case "darwin": + return filepath.Join(HomeDir(), "Library", "Camlistore", "blobs") + } + return filepath.Join(HomeDir(), "var", "camlistore", "blobs") +} + func CamliConfigDir() string { if p := os.Getenv("CAMLI_CONFIG_DIR"); p != "" { return p } if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "camli") + return filepath.Join(os.Getenv("APPDATA"), "Camlistore") } - return filepath.Join(HomeDir(), ".camli") + return filepath.Join(HomeDir(), ".camlistore") } func UserServerConfigPath() string {