Skip to content

Commit b2f11cc

Browse files
committed
Fix default config file not found
1 parent 27ec121 commit b2f11cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: configuration/configuration.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ func Init(configPath string) {
4646
// Get default data path if none was provided
4747
if configPath == "" {
4848
configPath = getDefaultArduinoDataDir()
49+
viper.AddConfigPath(configPath)
50+
} else {
51+
viper.AddConfigPath(filepath.Dir(configPath))
4952
}
5053

51-
// Add paths where to search for a config file
52-
viper.AddConfigPath(filepath.Dir(configPath))
53-
5454
// Bind env vars
5555
viper.SetEnvPrefix("ARDUINO")
5656
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))

0 commit comments

Comments
 (0)