summary refs log tree commit diff stats
path: root/storage/getdir_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/getdir_darwin.go')
-rw-r--r--storage/getdir_darwin.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/storage/getdir_darwin.go b/storage/getdir_darwin.go
new file mode 100644
index 0000000..8d6ebbf
--- /dev/null
+++ b/storage/getdir_darwin.go
@@ -0,0 +1,22 @@
+// +build darwin
+
+package storage
+
+import (
+	"fmt"
+	"os"
+)
+
+// GetDir returns grus data directory. Default data directory on
+// macOS is $HOME/Library.
+func GetDir() string {
+	cacheDir := fmt.Sprintf("%s/%s",
+		os.Getenv("HOME"),
+		"Library")
+
+	// Grus cache directory is cacheDir/grus
+	grusCacheDir := fmt.Sprintf("%s/%s", cacheDir,
+		"grus")
+
+	return grusCacheDir
+}