Skip to content

Commit 12af46c

Browse files
committed
Prefer command argument over configuration
1 parent cd026ad commit 12af46c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ func ParseConfig(config *Config) error {
5555
return err
5656
}
5757

58-
// overwrite configurations
59-
if configJson.Provider != nil {
58+
// overwrite configurations only when the default value is used
59+
if configJson.Provider != nil && config.Provider == DefaultProvider {
6060
config.Provider = *configJson.Provider
6161
}
62-
if configJson.ApiKey != nil {
62+
if configJson.ApiKey != nil && config.ApiKey == "" {
6363
config.ApiKey = *configJson.ApiKey
6464
}
65-
if configJson.EtherscanApiKey != nil {
65+
if configJson.EtherscanApiKey != nil && config.EtherscanApiKey == "" {
6666
config.EtherscanApiKey = *configJson.EtherscanApiKey
6767
}
6868

0 commit comments

Comments
 (0)