MCPcopy Create free account
hub / github.com/SamNet-dev/snix / defaultConfigPath

Function defaultConfigPath

cmd/snix/root.go:44–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func defaultConfigPath() string {
45 // Follows XDG on Linux/macOS, %APPDATA% on Windows.
46 if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" {
47 return filepath.Join(xdg, "snix", "config.yaml")
48 }
49 if appData := os.Getenv("APPDATA"); appData != "" {
50 return filepath.Join(appData, "snix", "config.yaml")
51 }
52 home, _ := os.UserHomeDir()
53 return filepath.Join(home, ".config", "snix", "config.yaml")
54}
55
56func loadConfig(g *globalFlags) (*config.Config, error) {
57 c, err := config.Load(g.configPath)

Callers 1

newRootCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected