Skip to content

Commit

Permalink
chore: Update shared.php to fix issues with source and network variables
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Sep 13, 2024
1 parent aa49802 commit 1738286
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bootstrap/helpers/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ function replaceLocalSource(Stringable $source, Stringable $replacedWith)
if ($source->startsWith('..')) {
$source = $source->replaceFirst('..', $replacedWith->value());
}
if ($source->endsWith('/')) {
if ($source->endsWith('/') && $source->value() !== '/') {
$source = $source->replaceLast('/', '');
}

Expand Down Expand Up @@ -3229,7 +3229,6 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
if ($isApplication && $isPullRequest) {
$source = $source."-pr-$pullRequestId";
}

LocalFileVolume::updateOrCreate(
[
'mount_path' => $target,
Expand Down Expand Up @@ -3548,7 +3547,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
if ($isApplication) {
$shouldGenerateLabelsExactly = $resource->destination->server->settings->generate_exact_labels;
$uuid = $resource->uuid;
$network = $resource->destination->network;
$network = data_get($resource, 'destination.network');
if ($isPullRequest) {
$uuid = "{$resource->uuid}-{$pullRequestId}";
}
Expand All @@ -3558,7 +3557,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
} else {
$shouldGenerateLabelsExactly = $resource->server->settings->generate_exact_labels;
$uuid = $resource->uuid;
$network = $resource->destination->network;
$network = data_get($resource, 'destination.network');
}
if ($shouldGenerateLabelsExactly) {
switch ($server->proxyType()) {
Expand Down

0 comments on commit 1738286

Please sign in to comment.