zrok/zrokdir/zrokdir.go
2023-01-09 11:28:26 -05:00

31 lines
499 B
Go

package zrokdir
import (
"os"
"path/filepath"
)
func configFile() (string, error) {
zrd, err := zrokDir()
if err != nil {
return "", err
}
return filepath.Join(zrd, "config.json"), nil
}
func environmentFile() (string, error) {
zrd, err := zrokDir()
if err != nil {
return "", err
}
return filepath.Join(zrd, "environment.json"), nil
}
func zrokDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {
return "", err
}
return filepath.Join(home, ".zrok"), nil
}