diff options
Diffstat (limited to 'cache/getdir_darwin.go')
-rw-r--r-- | cache/getdir_darwin.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cache/getdir_darwin.go b/cache/getdir_darwin.go new file mode 100644 index 0000000..fc47e7e --- /dev/null +++ b/cache/getdir_darwin.go @@ -0,0 +1,23 @@ +// +build darwin + +package cache + +import ( + "fmt" + "os" +) + +// GetDir returns cetus cache directory. Default cache directory on +// macOS is $HOME/Library/Caches. +func GetDir() string { + cacheDir = fmt.Sprintf("%s/%s/%s", + os.Getenv("HOME"), + "Library", + "Caches") + + // Cetus cache directory is cacheDir/cetus + cetusCacheDir = fmt.Sprintf("%s/%s", cacheDir, + "cetus") + + return cetusCacheDir +} |