Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/cli. OpenStatus CLI www.openstatus.dev
cli cli-app synthetic-monitoring
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435package config
import ( "fmt" "os" "path/filepath")
func ConfigDir() (string, error) { if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" { return filepath.Join(xdg, "openstatus"), nil } home, err := os.UserHomeDir() if err != nil { return "", fmt.Errorf("cannot determine home directory: %w", err) } return filepath.Join(home, ".config", "openstatus"), nil}
func TokenPath() (string, error) { dir, err := ConfigDir() if err != nil { return "", err } return filepath.Join(dir, "token"), nil}
func UserConfigPath() (string, error) { dir, err := ConfigDir() if err != nil { return "", err } return filepath.Join(dir, "config.yaml"), nil}