mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
[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 {
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user