blob: 80ba697f16c3399cb753d90be49cca6515a5a71e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package appconfig
const configPathFallback = "$XDG_CONFIG_HOME/hexai/config.toml"
// DefaultConfigPath returns the resolved config path or the documented XDG
// fallback when the real path cannot be determined.
func DefaultConfigPath() string {
return configPathOrFallback(ConfigPath)
}
func configPathOrFallback(resolve func() (string, error)) string {
path, err := resolve()
if err != nil {
return configPathFallback
}
return path
}
|