Skip to content
Myr

cmd: Fix minor bugs in init command (#446)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Behrang Noruzi Niya · committed by Albert Nigmatzianov · parent 90687e7 · Browse files · 2 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−6 removed

  • other:+6 added−6 removed

2 files+6 added−6 removed

modified:cobra/cmd/testdata/root.go.golden+3 added-3 removed
68 unmodified lines
69 } else {70 // Find home directory.71 home, err := homedir.Dir()72 if err != nil {73 fmt.Println(home)73 fmt.Println(err)74 os.Exit(1)75 }7677 // Search config in home directory with name ".cobra" (without extension).77 // Search config in home directory with name ".testproject" (without extension).78 viper.AddConfigPath(home)79 viper.SetConfigName(".cobra")79 viper.SetConfigName(".testproject")80 }8182 viper.AutomaticEnv() // read in environment variables that match83
5 unmodified lines
modified:cobra/cmd/init.go+3 added-3 removed
195 unmodified lines
196 } else {197 // Find home directory.198 home, err := homedir.Dir()199 if err != nil {200 fmt.Println(home)200 fmt.Println(err)201 os.Exit(1)202 }203204 // Search config in home directory with name ".cobra" (without extension).204 // Search config in home directory with name ".{{ .appName }}" (without extension).205 viper.AddConfigPath(home)206 viper.SetConfigName(".cobra")206 viper.SetConfigName(".{{ .appName }}")207 }208209 viper.AutomaticEnv() // read in environment variables that match210
24 unmodified lines