File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,12 +216,19 @@ provision_from_profile() {
216216
217217 [ " ${has_config} " = " 1" ] && opts+=(--existing-config)
218218
219- # When falling back with config files, update the profile in
220- # core.extension.yml to match the fallback profile to avoid
219+ # When falling back with config files, update core.extension.yml to
220+ # replace the original profile with the fallback profile to avoid
221221 # "does not match the profile stored in configuration" error.
222222 if [ " ${is_fallback} " = " 1" ] && [ " ${has_config} " = " 1" ]; then
223223 if [ -f " ${config_path} /core.extension.yml" ]; then
224+ local original_profile
225+ original_profile=" $( grep ' ^profile: ' " ${config_path} /core.extension.yml" | sed ' s/^profile: //' ) "
224226 sed -i " s/^profile: .*/profile: ${profile} /" " ${config_path} /core.extension.yml"
227+ if [ -n " ${original_profile} " ] && [ " ${original_profile} " != " ${profile} " ]; then
228+ sed -i " /^ ${original_profile} : /d" " ${config_path} /core.extension.yml"
229+ sed -i " /^ ${profile} : /d" " ${config_path} /core.extension.yml"
230+ sed -i " /^module:/a\\ ${profile} : 1000" " ${config_path} /core.extension.yml"
231+ fi
225232 fi
226233 fi
227234
You can’t perform that action at this time.
0 commit comments