Merge pull request #91 from giuseppe/xdg-config-home

config: honor XDG_CONFIG_HOME
This commit is contained in:
Daniel J Walsh 2020-03-13 10:43:08 -04:00 committed by GitHub
commit cc73e65485
1 changed files with 3 additions and 0 deletions

View File

@ -827,6 +827,9 @@ func isDirectory(path string) error {
} }
func rootlessConfigPath() (string, error) { func rootlessConfigPath() (string, error) {
if configHome := os.Getenv("XDG_CONFIG_HOME"); configHome != "" {
return filepath.Join(configHome, UserOverrideContainersConfig), nil
}
home, err := unshare.HomeDir() home, err := unshare.HomeDir()
if err != nil { if err != nil {
return "", err return "", err