fix(config): mask special chars in setting keys
This commit is contained in:
parent
7b5ca52836
commit
88ab852dfc
1 changed files with 5 additions and 2 deletions
|
@ -88,15 +88,18 @@ stringData:
|
|||
|
||||
env2ini::log " + '${setting}'"
|
||||
|
||||
local masked_setting="${setting//./_0X2E_}" # '//' instructs to replace all matches
|
||||
masked_setting="${masked_setting//-/_0X2D_}"
|
||||
|
||||
if [[ -z "${section}" ]]; then
|
||||
export "FORGEJO____${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
export "FORGEJO____${masked_setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
return
|
||||
fi
|
||||
|
||||
local masked_section="${section//./_0X2E_}" # '//' instructs to replace all matches
|
||||
masked_section="${masked_section//-/_0X2D_}"
|
||||
|
||||
export "FORGEJO__${masked_section^^}__${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
export "FORGEJO__${masked_section^^}__${masked_setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
}
|
||||
|
||||
function env2ini::reload_preset_envs() {
|
||||
|
|
Loading…
Reference in a new issue