We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c117338 commit 2b0d860Copy full SHA for 2b0d860
1 file changed
cmd/ctrlc/ctrlc.go
@@ -45,10 +45,8 @@ func main() {
45
}
46
47
func initConfig() {
48
- configProvided := false
49
if cfgFile != "" {
50
viper.SetConfigFile(cfgFile)
51
- configProvided = true
52
} else {
53
// Find home directory.
54
home, err := homedir.Dir()
@@ -64,7 +62,7 @@ func initConfig() {
64
62
65
63
66
if err := viper.ReadInConfig(); err != nil {
67
- if configProvided {
+ if cfgFile != "" {
68
log.Error("Can't read config", "error", err)
69
os.Exit(1)
70
0 commit comments