fix(update): preserve local model and effort

This commit is contained in:
Julian lechner committed 2026-09-17 11:45:00 +02:00
1 parent 7572ec40d9
commit 13594fb401
4 files changed
+36 -9

No files matched your search

+15 -1
View File
@@ -84,7 +84,21 @@ sync_managed_destination() {
new_hash=$(sha256_of_file "$source_file")
fi
if [ "$relative" = config.toml ] && [ -f "$target" ]; then
local plugin_tables
local plugin_tables local_settings setting_name
local_settings=$(awk '
/^[ \t]*\[/ { exit }
/^[ \t]*(model|reasoning_effort)[ \t]*=/ { print }
' "$target")
if [ -n "$local_settings" ]; then
while IFS= read -r setting; do
setting_name=${setting%%=*}
setting_name=${setting_name//[[:space:]]/}
content=$(printf '%s\n' "$content" | sed "/^[[:space:]]*$setting_name[[:space:]]*=/d")
done <<< "$local_settings"
content="$content"$'\n'"$local_settings"$'\n'
needs_sub=true
new_hash=$(sha256_of_string "$content")
fi
plugin_tables=$(awk '
/^[ \t]*\[/ { preserve = ($0 ~ /^[ \t]*\[(plugins|marketplaces)(\.|\])/) }
preserve { print }