This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ const (
25
25
26
26
const (
27
27
defaultTrackerListURL = "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt"
28
+ defaultConfigFile = "cloud-torrent"
28
29
)
29
30
30
31
type Config struct {
@@ -61,10 +62,8 @@ func InitConf(specPath *string) (*Config, error) {
61
62
// user specific config path
62
63
viper .SetConfigFile (* specPath )
63
64
} else {
64
- viper .SetConfigName ("cloud-torrent" )
65
- viper .AddConfigPath ("/etc/cloud-torrent/" )
65
+ viper .SetConfigName (defaultConfigFile )
66
66
viper .AddConfigPath ("/etc/" )
67
- viper .AddConfigPath ("$HOME/.cloud-torrent" )
68
67
viper .AddConfigPath ("." )
69
68
}
70
69
@@ -93,9 +92,10 @@ func InitConf(specPath *string) (*Config, error) {
93
92
// write a default config file if not exists and not provided
94
93
c := & Config {}
95
94
viper .Unmarshal (c )
96
- c .WriteYaml ("cloud-torrent.yaml" )
97
- log .Println ("saved default config cloud-torrent.yaml" )
98
- viper .SetConfigFile ("cloud-torrent.yaml" )
95
+ cn := defaultConfigFile + ".yaml"
96
+ c .WriteYaml (cn )
97
+ viper .SetConfigFile (cn )
98
+ log .Println ("saved default config" , cn )
99
99
}
100
100
}
101
101
You can’t perform that action at this time.
0 commit comments