mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 16:14:22 +02:00
Refactor services.php file to improve variable replacement logic
This commit is contained in:
parent
c36636bd2d
commit
11baa97ef6
@ -18,7 +18,7 @@ function collectRegex(string $name)
|
|||||||
}
|
}
|
||||||
function replaceVariables($variable)
|
function replaceVariables($variable)
|
||||||
{
|
{
|
||||||
return $variable->replaceFirst('$', '')->replaceFirst('{', '')->replaceLast('}', '');
|
return $variable->before('}')->replaceFirst('$', '')->replaceFirst('{', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Application $oneService, bool $isInit = false)
|
function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Application $oneService, bool $isInit = false)
|
||||||
@ -27,7 +27,7 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Appli
|
|||||||
if ($oneService->getMorphClass() === 'App\Models\Application') {
|
if ($oneService->getMorphClass() === 'App\Models\Application') {
|
||||||
$workdir = $oneService->workdir();
|
$workdir = $oneService->workdir();
|
||||||
$server = $oneService->destination->server;
|
$server = $oneService->destination->server;
|
||||||
} else{
|
} else {
|
||||||
$workdir = $oneService->service->workdir();
|
$workdir = $oneService->service->workdir();
|
||||||
$server = $oneService->service->server;
|
$server = $oneService->service->server;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user