diff options
author | Andinus <andinus@nand.sh> | 2020-04-06 22:18:33 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-04-06 22:18:33 +0530 |
commit | 58644f4ccc72550481c5d0cc15360dfa40b6c648 (patch) | |
tree | f7a60dba6b0e0aacae84b31a3570f4360f72cf76 /storage | |
parent | da2255557fa395eeabeff9a4f2949582f8811980 (diff) | |
download | grus-58644f4ccc72550481c5d0cc15360dfa40b6c648.tar.gz |
Define GetDir on macOS
Diffstat (limited to 'storage')
-rw-r--r-- | storage/getdir_darwin.go | 22 |
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 +} |