Compare commits

..

1 Commits
v1.0.1 ... main

Author SHA1 Message Date
Timon Ringwald
a3adc3b91d fixed bugs 2022-08-17 20:25:17 +02:00

View File

@ -15,14 +15,13 @@ func Path(fileExtension string) (string, error) {
paths := []string{ paths := []string{
filepath.Join("/etc/", executableName, configFileName), filepath.Join("/etc/", executableName, configFileName),
filepath.Join("/etc/", configFileName), filepath.Join("/etc/", configFileName),
filepath.Join("etc", configFileName),
filepath.Join(userConfigDir, executableName, configFileName), filepath.Join(userConfigDir, executableName, configFileName),
filepath.Join(userConfigDir, configFileName), filepath.Join(userConfigDir, configFileName),
filepath.Clean(configFileName), filepath.Clean(configFileName),
} }
for _, path := range paths { for _, path := range paths {
if _, err := os.Stat(path); err != nil { if _, err := os.Stat(path); err == nil {
return path, nil return path, nil
} }
} }