config: honor XDG_CONFIG_HOME
when the env variable is set, use its value for locating the user configuration file. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
88eaa67192
commit
9322b03394
|
|
@ -827,6 +827,9 @@ func isDirectory(path string) error {
|
|||
}
|
||||
|
||||
func rootlessConfigPath() (string, error) {
|
||||
if configHome := os.Getenv("XDG_CONFIG_HOME"); configHome != "" {
|
||||
return filepath.Join(configHome, UserOverrideContainersConfig), nil
|
||||
}
|
||||
home, err := unshare.HomeDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
Loading…
Reference in New Issue