@@ -12,6 +12,8 @@ import (
12
12
)
13
13
14
14
var (
15
+ XDGAppName = "resticprofile"
16
+
15
17
// configurationExtensions list the possible extensions for the config file
16
18
configurationExtensions = []string {
17
19
"conf" ,
@@ -82,7 +84,10 @@ func FindConfigurationFile(configFile string) (string, error) {
82
84
return found , nil
83
85
}
84
86
// compile a list of search locations
85
- locations := append ([]string {xdg .ConfigHome }, xdg .ConfigDirs ... )
87
+ locations := []string {filepath .Join (xdg .ConfigHome , XDGAppName )}
88
+ for _ , configDir := range xdg .ConfigDirs {
89
+ locations = append (locations , filepath .Join (configDir , XDGAppName ))
90
+ }
86
91
locations = append (locations , getDefaultConfigurationLocations ()... )
87
92
if home , err := os .UserHomeDir (); err == nil {
88
93
locations = append (locations , home )
@@ -97,7 +102,7 @@ func findConfigurationFileWithExtension(configFile string) string {
97
102
}
98
103
99
104
// 2. Next we try xdg as the "standard" for user configuration locations
100
- xdgFilename , err := xdg .SearchConfigFile (filepath .Join ("resticprofile" , configFile ))
105
+ xdgFilename , err := xdg .SearchConfigFile (filepath .Join (XDGAppName , configFile ))
101
106
if err == nil {
102
107
if fileExists (xdgFilename ) {
103
108
return xdgFilename
0 commit comments