@@ -128,21 +128,21 @@ func getOrSetDefaults(envVar string) {
128
128
func InitConfig () {
129
129
if config != "" {
130
130
viper .SetConfigFile (config )
131
- os .Setenv ("GHORG_CONF " , config )
131
+ os .Setenv ("GHORG_CONFIG " , config )
132
132
} else {
133
133
config = configs .DefaultConfFile ()
134
134
viper .SetConfigType ("yaml" )
135
135
viper .AddConfigPath (configs .GhorgDir ())
136
136
viper .SetConfigName ("conf" )
137
- os .Setenv ("GHORG_CONF " , configs .DefaultConfFile ())
137
+ os .Setenv ("GHORG_CONFIG " , configs .DefaultConfFile ())
138
138
139
139
}
140
140
141
141
if err := viper .ReadInConfig (); err != nil {
142
142
if _ , ok := err .(viper.ConfigFileNotFoundError ); ok {
143
- os .Setenv ("GHORG_CONF " , "none" )
143
+ os .Setenv ("GHORG_CONFIG " , "none" )
144
144
} else {
145
- colorlog .PrintError (fmt .Sprintf ("Something unexpected happened reading configuration file: %s, err: %s" , os .Getenv ("GHORG_CONF " ), err ))
145
+ colorlog .PrintError (fmt .Sprintf ("Something unexpected happened reading configuration file: %s, err: %s" , os .Getenv ("GHORG_CONFIG " ), err ))
146
146
os .Exit (1 )
147
147
}
148
148
}
@@ -184,7 +184,7 @@ func InitConfig() {
184
184
if os .Getenv ("GHORG_DEBUG" ) != "" {
185
185
viper .Debug ()
186
186
fmt .Println ("Viper config file used:" , viper .ConfigFileUsed ())
187
- fmt .Printf ("GHORG_CONF SET TO: %s\n " , os .Getenv ("GHORG_CONF " ))
187
+ fmt .Printf ("GHORG_CONFIG SET TO: %s\n " , os .Getenv ("GHORG_CONFIG " ))
188
188
}
189
189
190
190
}
@@ -193,7 +193,7 @@ func init() {
193
193
cobra .OnInitialize (InitConfig )
194
194
195
195
rootCmd .PersistentFlags ().StringVar (& color , "color" , "" , "GHORG_COLOR - toggles colorful output, enabled/disabled (default: disabled)" )
196
- rootCmd .PersistentFlags ().StringVar (& config , "config" , "" , "manually set the path to your config file" )
196
+ rootCmd .PersistentFlags ().StringVar (& config , "config" , "" , "GHORG_CONFIG - manually set the path to your config file" )
197
197
198
198
viper .SetDefault ("config" , configs .DefaultConfFile ())
199
199
0 commit comments