mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-06 04:58:33 +02:00
Allow editing config option after renaming
This commit is contained in:
parent
1ef498943b
commit
93767df567
3 changed files with 17 additions and 9 deletions
|
@ -83,6 +83,12 @@ func PromptExtraOptions(config config.ServiceConfig) (config.ServiceConfig, erro
|
|||
current, exists := config.ConfigValues[opt.Name]
|
||||
if exists {
|
||||
opt.Default = fmt.Sprintf("%v", current)
|
||||
} else if opt.MigrateFrom != "" {
|
||||
// If there is an old value to migrate from, try that
|
||||
fallback, exists := config.ConfigValues[opt.MigrateFrom]
|
||||
if exists {
|
||||
opt.Default = fmt.Sprintf("%v", fallback)
|
||||
}
|
||||
}
|
||||
|
||||
val, err := Prompt(opt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue