Skip to content

Commit fdfab9c

Browse files
j-dstof
authored andcommitted
Fixes #20 - Top-level keys on the yml files other than 'parameters' were not being maintained
1 parent 14cd66d commit fdfab9c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 2.1.0 (2013-XX-XX)
22

3+
* Fixes #20 - Preserve other top-level keys than ``parameters`` in the file
34
* Add a rename map used to rename parameters when updating the parameters file
45
* Add the possibility to use another top-level key than ``parameters``
56

ScriptHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ public static function buildParameters(Event $event)
8787

8888
$actualParams = self::getParams($io, $expectedParams, $actualParams);
8989

90-
file_put_contents($realFile, "# This file is auto-generated during the composer install\n" . Yaml::dump(array($parameterKey => $actualParams), 99));
90+
// Preserve other top-level keys than `$parameterKey` in the file
91+
$actualValues[$parameterKey] = $actualParams;
92+
93+
file_put_contents($realFile, "# This file is auto-generated during the composer install\n" . Yaml::dump($actualValues, 99));
9194
}
9295

9396
private static function getEnvValues(array $envMap)

0 commit comments

Comments
 (0)