Skip to content

Commit 785883c

Browse files
authored
Merge pull request #52 from schloram/schloram-patch-1
2 parents bd32e6c + cecccdf commit 785883c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Install/Action/SetupConfigurationAction.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ private function populateCustomSettings(array $actionDefinition, array $options)
8989
foreach ($arguments as $argumentName => $argumentValue) {
9090
$customConfig = Config::setValue($customConfig, $argumentDefinitions[$argumentName]['configPath'], $argumentValue);
9191
}
92+
if ($customConfig === []) {
93+
return;
94+
}
9295
$this->addValuesToOverrides($customConfig);
9396
}
9497

@@ -125,8 +128,12 @@ private function removeOverrides(array $actionDefinition): void
125128
private function addValuesToOverrides(array $values): void
126129
{
127130
$configFile = SettingsFiles::getOverrideSettingsFile();
128-
$currentConfig = (new ConfigurationReaderFactory(dirname($configFile)))->createReader($configFile)->readConfig();
129-
$this->configDumper->dumpToFile(array_replace_recursive($currentConfig, $values), $configFile);
131+
$reader = (new ConfigurationReaderFactory(dirname($configFile)))->createReader($configFile);
132+
$currentConfig = $reader->hasConfig() ? $reader->readConfig() : [];
133+
$this->configDumper->dumpToFile(
134+
array_replace_recursive($currentConfig, $values),
135+
$configFile
136+
);
130137
}
131138

132139
private function copyEnvDistFile(): void

0 commit comments

Comments
 (0)