[config] let user know if they are unsetting a non-existent config key

This commit is contained in:
Alex Quick
2017-12-15 09:22:56 -05:00
parent e7faec3e26
commit 92d7e8ce65

View File

@@ -70,9 +70,15 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
if err = validateKey(k); err != nil {
return
}
common.LogInfo1(fmt.Sprintf("Unsetting %s", k))
env.Unset(k)
changed = true
}
for _, k := range keys {
if _, hasKey := env.Map()[k]; hasKey {
common.LogInfo1(fmt.Sprintf("Unsetting %s", k))
env.Unset(k)
changed = true
} else {
common.LogInfo1(fmt.Sprintf("Skipping %s, it is not set in the environment", k))
}
}
if changed {
env.Write()