Skip to content

fix(runner): improve config merging logic to prevent overwriting specific settings#41

Open
zboinek wants to merge 1 commit into
Byloth:masterfrom
zboinek:master
Open

fix(runner): improve config merging logic to prevent overwriting specific settings#41
zboinek wants to merge 1 commit into
Byloth:masterfrom
zboinek:master

Conversation

@zboinek
Copy link
Copy Markdown

@zboinek zboinek commented May 15, 2026

If not applied changes like Rate.XP.Kill.Vanilla are interpreted as Rate.XP.Kill so 4th lvl nested items doesnt work

In the official repository's runner/entrypoint.sh (https://github.com/Byloth/cmangos-docker/blob/master/runner/entrypoint.sh), the function is defined as:

1 function _replace_conf()
2 {
3 local SEARCH_FOR="${1}"
4 local REPLACE_WITH="${2}"
5 local FILENAME="${3}"
6
7 sed -i "/^${SEARCH_FOR}/c\${SEARCH_FOR} = ${REPLACE_WITH}" "${FILENAME}"
8 }

Why this is a bug in their repo:
The pattern /^${SEARCH_FOR}/ only checks if a line starts with the search term.

  • If ${SEARCH_FOR} is Rate.XP.Kill, it matches Rate.XP.Kill.Vanilla.
  • The c command then replaces that entire line.
  • The result is that the expansion-specific settings are deleted and turned into duplicates of the global setting.

@zboinek zboinek requested a review from Byloth as a code owner May 15, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant