Skip to content

Commit 8385b7d

Browse files
committed
fix: handle edge case when build variables and env variables are in different format
1 parent a660117 commit 8385b7d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bootstrap/helpers/shared.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3826,6 +3826,21 @@ function convertComposeEnvironmentToArray($environment)
38263826
{
38273827
$convertedServiceVariables = collect([]);
38283828
if (isAssociativeArray($environment)) {
3829+
if ($environment instanceof Collection) {
3830+
$changedEnvironment = collect([]);
3831+
$environment->each(function ($value, $key) use ($changedEnvironment) {
3832+
$parts = explode('=', $value, 2);
3833+
if (count($parts) === 2) {
3834+
$key = $parts[0];
3835+
$realValue = $parts[1] ?? '';
3836+
$changedEnvironment->put($key, $realValue);
3837+
} else {
3838+
$changedEnvironment->put($key, $value);
3839+
}
3840+
});
3841+
3842+
return $changedEnvironment;
3843+
}
38293844
$convertedServiceVariables = $environment;
38303845
} else {
38313846
foreach ($environment as $value) {

0 commit comments

Comments
 (0)