mirror of
https://github.com/gopasspw/gopass.git
synced 2026-09-30 11:16:53 +02:00
re-use RELEASE_NOTES=n/a Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
33 lines
720 B
Go
33 lines
720 B
Go
package appdir
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// UserConfig returns the users config dir
|
|
func UserConfig() string {
|
|
if hd := os.Getenv("GOPASS_HOMEDIR"); hd != "" {
|
|
return filepath.Join(hd, ".config", Name)
|
|
}
|
|
|
|
return filepath.Join(os.Getenv("APPDATA"), Name)
|
|
}
|
|
|
|
// UserCache returns the users cache dir
|
|
func UserCache() string {
|
|
if hd := os.Getenv("GOPASS_HOMEDIR"); hd != "" {
|
|
return filepath.Join(hd, ".cache", Name)
|
|
}
|
|
|
|
return filepath.Join(os.Getenv("LOCALAPPDATA"), Name)
|
|
}
|
|
|
|
// UserData returns the users data dir
|
|
func UserData() string {
|
|
if hd := os.Getenv("GOPASS_HOMEDIR"); hd != "" {
|
|
return filepath.Join(hd, ".local", "share", Name)
|
|
}
|
|
return filepath.Join(os.Getenv("LOCALAPPDATA"), Name)
|
|
}
|