[config] let user know if they are unsetting a non-existent config key
This commit is contained in:
@@ -70,9 +70,15 @@ func UnsetMany(appName string, keys []string, restart bool) (err error) {
|
|||||||
if err = validateKey(k); err != nil {
|
if err = validateKey(k); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
common.LogInfo1(fmt.Sprintf("Unsetting %s", k))
|
}
|
||||||
env.Unset(k)
|
for _, k := range keys {
|
||||||
changed = true
|
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 {
|
if changed {
|
||||||
env.Write()
|
env.Write()
|
||||||
|
|||||||
Reference in New Issue
Block a user