Skip to content

Commit

Permalink
Merge pull request #52 from schloram/schloram-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
helhum authored Feb 7, 2024
2 parents bd32e6c + cecccdf commit 785883c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Install/Action/SetupConfigurationAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private function populateCustomSettings(array $actionDefinition, array $options)
foreach ($arguments as $argumentName => $argumentValue) {
$customConfig = Config::setValue($customConfig, $argumentDefinitions[$argumentName]['configPath'], $argumentValue);
}
if ($customConfig === []) {
return;
}
$this->addValuesToOverrides($customConfig);
}

Expand Down Expand Up @@ -125,8 +128,12 @@ private function removeOverrides(array $actionDefinition): void
private function addValuesToOverrides(array $values): void
{
$configFile = SettingsFiles::getOverrideSettingsFile();
$currentConfig = (new ConfigurationReaderFactory(dirname($configFile)))->createReader($configFile)->readConfig();
$this->configDumper->dumpToFile(array_replace_recursive($currentConfig, $values), $configFile);
$reader = (new ConfigurationReaderFactory(dirname($configFile)))->createReader($configFile);
$currentConfig = $reader->hasConfig() ? $reader->readConfig() : [];
$this->configDumper->dumpToFile(
array_replace_recursive($currentConfig, $values),
$configFile
);
}

private function copyEnvDistFile(): void
Expand Down

0 comments on commit 785883c

Please sign in to comment.