summary refs log tree commit diff stats
path: root/cache/getdir_darwin.go
blob: d605d73ce9ec5055d956306a02556aa0097ddee7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// +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
}

// Dir returns "/dev/null", this is required because unveil func in
// main.go calls it & it's useless on macOS anyways so we return
// "/dev/null".
func Dir() string {
	return "/dev/null"
}