Do not overwrite if user already had expected entries

This commit is contained in:
Harshavardhana
2015-07-23 14:35:57 -07:00
parent 2e23ca3ce9
commit ee0fe86178
+6 -2
View File
@@ -198,8 +198,12 @@ func migrateConfigV1ToV101() {
localHostConfig.AccessKeyID = ""
localHostConfig.SecretAccessKey = ""
conf.Hosts["localhost:*"] = localHostConfig
conf.Hosts["127.0.0.1:*"] = localHostConfig
if _, ok := conf.Hosts["localhost:*"]; !ok {
conf.Hosts["localhost:*"] = localHostConfig
}
if _, ok := conf.Hosts["127.0.0.1:*"]; !ok {
conf.Hosts["127.0.0.1:*"] = localHostConfig
}
newConfig, err := quick.New(conf)
if err := newConfig.Save(mustGetMcConfigPath()); err != nil {