Skip to content

Commit bfeaae9

Browse files
committed
fix: env variable in value parsed
1 parent ba90a52 commit bfeaae9

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

app/Livewire/Project/Service/EditCompose.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function saveEditedCompose()
4343
{
4444
$this->dispatch('info', 'Saving new docker compose...');
4545
$this->dispatch('saveCompose', $this->service->docker_compose_raw);
46+
$this->dispatch('refreshStorages');
4647
}
4748

4849
public function instantSave()

app/Livewire/Project/Shared/EnvironmentVariable/All.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class All extends Component
2424

2525
protected $listeners = [
2626
'saveKey' => 'submit',
27+
'refreshEnvs',
2728
'environmentVariableDeleted' => 'refreshEnvs',
2829
];
2930

@@ -61,7 +62,7 @@ public function sortEnvironmentVariables()
6162
$sortBy = data_get($this->resource, 'settings.is_env_sorting_enabled') ? 'key' : 'order';
6263

6364
$sortFunction = function ($variables) use ($sortBy) {
64-
if (!$variables) {
65+
if (! $variables) {
6566
return $variables;
6667
}
6768
if ($sortBy === 'key') {

app/Livewire/Project/Shared/EnvironmentVariable/Show.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ public function delete()
136136
return handleError($e);
137137
}
138138
}
139-
}
139+
}

bootstrap/helpers/shared.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3331,7 +3331,10 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
33313331
foreach ($normalEnvironments as $key => $value) {
33323332
$key = str($key);
33333333
$value = str($value);
3334-
if ($value->startsWith('$')) {
3334+
if ($value->startsWith('$') || $value->contains('${')) {
3335+
if ($value->contains('${')) {
3336+
$value = $value->after('${')->before('}');
3337+
}
33353338
$value = str(replaceVariables(str($value)));
33363339
if ($value->contains(':-')) {
33373340
$key = $value->before(':');

0 commit comments

Comments
 (0)