fix: handle edge case when build variables and env variables are in different format
This commit is contained in:
parent
a660117015
commit
8385b7dfe8
1 changed files with 15 additions and 0 deletions
|
|
@ -3826,6 +3826,21 @@ function convertComposeEnvironmentToArray($environment)
|
|||
{
|
||||
$convertedServiceVariables = collect([]);
|
||||
if (isAssociativeArray($environment)) {
|
||||
if ($environment instanceof Collection) {
|
||||
$changedEnvironment = collect([]);
|
||||
$environment->each(function ($value, $key) use ($changedEnvironment) {
|
||||
$parts = explode('=', $value, 2);
|
||||
if (count($parts) === 2) {
|
||||
$key = $parts[0];
|
||||
$realValue = $parts[1] ?? '';
|
||||
$changedEnvironment->put($key, $realValue);
|
||||
} else {
|
||||
$changedEnvironment->put($key, $value);
|
||||
}
|
||||
});
|
||||
|
||||
return $changedEnvironment;
|
||||
}
|
||||
$convertedServiceVariables = $environment;
|
||||
} else {
|
||||
foreach ($environment as $value) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue