mirror of https://github.com/cheat/cheat.git
chore: refactors `config.path` (small)
Performs a minor refactoring on `config.Paths` to consistently use `path.Join` when computing config directory paths. Previously, both `path.Join` and `fmt.Sprintf` were being used, strictly due to an oversight.
This commit is contained in:
parent
8a313b92ca
commit
408e944eea
|
@ -32,8 +32,8 @@ func Paths(sys string, envvars map[string]string) ([]string, error) {
|
||||||
}, nil
|
}, nil
|
||||||
case "windows":
|
case "windows":
|
||||||
return []string{
|
return []string{
|
||||||
fmt.Sprintf("%s/cheat/conf.yml", envvars["APPDATA"]),
|
path.Join(envvars["APPDATA"], "/cheat/conf.yml"),
|
||||||
fmt.Sprintf("%s/cheat/conf.yml", envvars["PROGRAMDATA"]),
|
path.Join(envvars["PROGRAMDATA"], "/cheat/conf.yml"),
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
default:
|
||||||
return []string{}, fmt.Errorf("unsupported os: %s", sys)
|
return []string{}, fmt.Errorf("unsupported os: %s", sys)
|
||||||
|
|
Loading…
Reference in New Issue