mirror of
https://github.com/gopasspw/gopass.git
synced 2026-05-30 11:18:48 +02:00
71861e4a8b
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
28 lines
507 B
Go
28 lines
507 B
Go
//go:build !windows
|
|
|
|
package appdir
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// UserRuntime returns the users runtime dir.
|
|
func (a *Appdir) UserRuntime() string {
|
|
if hd := os.Getenv("GOPASS_HOMEDIR"); hd != "" {
|
|
return filepath.Join(hd, ".run")
|
|
}
|
|
|
|
base := os.Getenv("XDG_RUNTIME_DIR")
|
|
if base == "" {
|
|
base = filepath.Join(os.Getenv("HOME"), ".run")
|
|
}
|
|
|
|
return filepath.Join(base, a.name)
|
|
}
|
|
|
|
// UserRuntime returns the users runtime dir.
|
|
func UserRuntime() string {
|
|
return DefaultAppdir.UserRuntime()
|
|
}
|