refactor(devgen/cli): reorder config merge to preserve key order
Preserves insertion order and prevents accidental overwriting of existing keys
This commit is contained in:
1 file changed
+10
-7
+10
-7
@@ -86,13 +86,16 @@ def setup_config() -> None:
|
|||||||
ollama_host = ollama_host_input.strip() or ollama_host
|
ollama_host = ollama_host_input.strip() or ollama_host
|
||||||
|
|
||||||
# Save Config — merge with existing to preserve extra keys
|
# Save Config — merge with existing to preserve extra keys
|
||||||
new_config = {**current_config, **{
|
new_config = {
|
||||||
"provider": provider,
|
**current_config,
|
||||||
"model": model,
|
**{
|
||||||
"api_key": api_key,
|
"provider": provider,
|
||||||
"emoji": emoji,
|
"model": model,
|
||||||
"ollama_host": ollama_host,
|
"api_key": api_key,
|
||||||
}}
|
"emoji": emoji,
|
||||||
|
"ollama_host": ollama_host,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with config_path.open("w", encoding="utf-8") as f:
|
with config_path.open("w", encoding="utf-8") as f:
|
||||||
|
|||||||
Reference in new issue
Block a user